bash file, mysql command update syntax error

25 views Asked by At

Hi I want to make a script I can run via cron to update certain columns on a schedule

The script command not running it in sh file works fine

UPDATE `lines` SET allowed_outputs = '[1,2]';

in the sh file I've added it like this

mysql --user="username" --password="pass" --database="data" -s --execute="UPDATE 'lines' SET allowed_outputs = '[1,2]';"

but I get an error

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''lines' SET allowed_outputs = '[1,2]'' at line 1

i'm sure its something to do with 'lines'

i've also tried backtags aswell

mysql --user="username" --password="pass" --database="data" -s --execute="UPDATE `lines` SET allowed_outputs = '[1,2]';"
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET allowed_outputs = '[1,2]'' at line 1
0

There are 0 answers