mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual t


1、備份mysql數據庫時候出錯,導出數據:

[root@localhost ~]# mysqldump -uroot -p mysql >/root/bck.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)

2、查詢是否mysqldump版本問題:

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

3、用5.6.23版本的mysqldump覆蓋或者指定目錄運行即可

[root@localhost 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、查看是否備份成功:

[root@localhost mysql]# mysqldump -uroot -h127.0.0.1  -p test > /root/1.sql
Enter password: 
[root@localhost ~]# 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`)
.....................

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM