How to get useful error information from mysql command?
Quoting of column names and table names (and some other things) is with backtics:

(`key` INT ...


You can change that with a sql_mode, but MySQL users rarely do that.

In the long run, I think you will abandon using shell scripts to run MySQL commands.