I'm trying to run an update query on a db server via bash command. I have to update an IP field (which is sorted as a string) but i'm getting a syntax error...
ssh [email protected] "/usr/local/mysql/bin/mysql -D SMARTPARK -u parkuser -ppass -e 'update client SET online=0 where client_ip='192.168.42.11''"
I'm getting as error
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.42.11' at line 1
which is the error?
"update client SET online=0 where client_ip='192.168.42.11'""and'to make sure you don't escape from your script