mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1'

[root@localhost tmp]# mysqldump -u root -p --database iwebmall > iwebmall.sql
Enter password: 
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=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 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064)
[root@localhost tmp]# mysqldump -p123 --socket=/var/run/mysqld/mysql5.socket --databases iwebmall --table imall_goods --lock-tables >googs.sql

mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=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 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064)


在使用mysqldump备份数据库的时候报如下错误mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=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 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064)

经排查发现是数据库版本问题、安装的是mysql5.6 、执行该命令是mysql5.5遗留下来的二进制文件、验证如下

[root@bogon backup]# which mysqldump
/usr/bin/mysqldump

最后找到解决办法、用新安装的mysql绝对路径来实现备份

[root@localhost tmp]# /usr/local/mysql/bin/mysqldump -u root -pYsdlde7  --database iwebmall > iwebmall.sql

[root@localhost tmp]#

你可能感兴趣的:(linux,运维,mysql数据库)