mysql - Error generating mysqldump with flush tables read lock option -


I have written a simple Bash script that generates mysqldump while locking the table.

  # Mysqldump will be used on the client side Q1 = "USE test;" Q2 = "Flush table with Reed Lock"; Q3 = "System / USR / Bin / MySakDump-U Route - Master-Data = 1 - OPT SSC" /var/opt/backup.sql "Q4 =" Unlock Table; " Mysql query $ mysql-root- "$ SQL" SQL = "$ {Q1} $ {Q2} $ {Q3} to run SQL =" $ {Q1} $ {Q2} $ {Q1} $ {Q2} $ {Q3} $ {Q2} $ {Q4} "  

I see this error when I run this script

  mysqldump: table could not be found:" tab "< / Code>  

But the strange thing is that if I run these commands manually on mysql, then everything works as expected.

  mysql> Use the exam; Reading the table's information to complete the table and column names You can turn off this feature to get a quick startup- A database has mysql & gt; Flush table with read lock; The query is ok, affecting 0 rows (0.00 seconds) mysql & gt; System / USR / Bin / MyScouldm-U root - Master-Data = 1 --opt test & gt; /var/opt/backup.sql mysql & gt; Unlock tables; The query is ok, affecting 0 rows (0.00 seconds) mysql & gt; Unlock tables; The query is ok, affecting 0 rows (0.00 seconds) mysql & gt;   

Will someone tell me that I am not clear at all?

You did not close Q3 with semi-colon Please see your details below:

  Q3 = "system / usr / bin / mysqldump -u root - master-data = 1 - opt SSC> /var/opt/backup.sql"   

Should be

  Q3 = "system / usr / bin / mysqldump -u root --master-data = 1 - opt SSC & gt; /var/opt/backup.sql," < / Code>   

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -