mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in y

Posted KING

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in y相关的知识,希望对你有一定的参考价值。

1、备份mysql数据库时候出错,导出数据:

[[email protected] ~]# mysqldump -uroot -p mysql >/root/bck.sql
Enter password: 
mysqldump: Couldnt 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)

2、查询是否mysqldump版本问题:

[[email protected] ~]# mysqldump --version
mysqldump  Ver 10.13 Distrib 5.1.71, for redhat-linux-gnu (x86_64)
[[email protected] ~]# which mysqldump
/usr/bin/mysqldump

3、用5.6.23版本的mysqldump覆盖或者指定目录运行即可

[[email protected] mysql]# cp /opt/mysql/mysql-5.6.23-linux-glibc2.5-x86_64/bin/mysqldump  /usr/bin/mysqldump 
cp: overwrite `/usr/bin/mysqldump? y

4、查看是否备份成功:

[[email protected] mysql]# mysqldump -uroot -h127.0.0.1  -p test > /root/1.sql
Enter password: 
[[email protected] ~]# cat 1.sql
DROP TABLE IF EXISTS `SC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SC` (
  `Scid` int(12) NOT NULL AUTO_INCREMENT,
  `Cno` int(10) NOT NULL,
  `Sno` int(10) NOT NULL,
  `Grade` tinyint(2) NOT NULL,
  PRIMARY KEY (`Scid`)
.....................

 

以上是关于mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in y的主要内容,如果未能解决你的问题,请参考以下文章

Why mysqldump is returning with error 1143: Couldn't execute 'show table status like

解决mysqldump备份报错: Couldn't execute 'SHOW FIELDS FROM Unknown error 1356

mysqldump:Couldn't find table:";"是怎么回事

linux g++安装 E: Couldn't find package g

Couldn't load libPassword from loader:NDK开发中C文件编译成cpu的so类库时,找不到类库报错的原因之一

解决Warning Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get fil