1, problem description
Using mysqldump Backup, Backup command:
[Email protected] opt]# mysqldump-uroot-p--skip-quote-names--databases Test--tables t >test1.sql
Mysqldump:couldn ' t execute ' SET OPTION sql_quote_show_create=1 ': You have a error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use-near ' OPTION sql_quote_show_cre Ate=1 ' at line 1 (1064)
2. Exploration of problems
2.1 Changing the parameter Sql_quote_show_create status value
Mysql> Show variables like ' sql_quote_show_create ';
+-----------------------+-------+
| variable_name | Value |
+-----------------------+-------+
| Sql_quote_show_create | On |
+-----------------------+-------+
1 row in Set (0.01 sec)
mysql> set global Sql_quote_show_create=off;
Query OK, 0 rows Affected (0.00 sec)
Mysql> exit
Bye
Continuing with the above backup, the problem remains.
2.2 Version Query
Query MySQL current version:
Mysql> select version ();
+-----------+
| Version () |
+-----------+
| 5.6.20 |
+-----------+
1 row in Set (0.00 sec)
Query the system for a Legacy installation package:
[[email protected] opt]# rpm-qa|grep-i MySQL
Mysql-5.0.95-5.el5_9
Mysql-python-1.2.3-0.1.c1.el5
As you can see, there are mysql5.0 installation packages available here.
2.3 Attempt to perform backup from mysqldump source path
Check mysqldump location:
[email protected] opt]# which mysqldump
/usr/bin/mysqldump
Back up again, OK.
[Email protected] opt]#/usr/local/mysql/bin/mysqldump-uroot-p--skip-quote-names--databases Test--tables t >test 1.sql
3. Solutions
[Email protected] bin]# ls-l mysqldump
-rwxr-xr-x 1 root root 66860 Jan mysqldump
[[Email protected] bin]# Date
Wed Dec 11:39:37 CST 2014
[Email protected] bin]# rm-f/usr/bin/mysqldump
[Email protected] bin]# cp/usr/local/mysql/bin/mysqldump/usr/bin/
[Email protected] bin]#/usr/local/mysql/bin/mysqldump-uroot-p--skip-quote-names--complete-insert--databases test --tables T >test1.sql
Enter Password:
[Email protected] bin]#
Delete the/usr/bin directory mysqldump, the/usr/local/mysql/bin directory under the mysqldump copy of the past, the problem solved.
Mysqldump:couldn ' t execute ' SET OPTION sql_quote_show_create=1 ' problem