learner learner - 4 months ago 49
MySQL Question

myqsldump thowing an error code (1054)

Can you please advise me what I am doing wrong here? My sqldump command is not working correctly as it ?

mysqldump -u jim -p mydb mytable --where mycondition="ERROR-5000-JAVA" > /home/jim/issue1.sql
Enter password:
mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `mytable` WHERE mycondition=ERROR-5000': Unknown column 'ERROR' in 'where clause' (1054)


You need quotes around the whole --where option, so that the double quotes around the value will be sent to MySQL.

mysqldump -u jim -p mydb mytable --where 'mycondition="ERROR-5000-JAVA"' > /home/jim/issue1.sql