Errors when using mysqldump for data export

Source: Internet
Author: User

1, using the mysqldump times error (1064), this is because the mysqldump version is too low due to the current database version inconsistency.
Mysqldump:couldn ' t execute ' SET OPTION sql_quote_show_create=1 ': You have a 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 ' on line 1 (1064 )

[Email protected] ~]# mysqldump--version
Mysqldump Ver 10.13 Distrib 5.1.61, for Redhat-linux-gnu (x86_64)

[[email protected] ~]# MySQL
Server Version:5.6.25-log Source Distribution
。。。。。

In this case you must know the absolute path of the mysqldump, which is available in the MySQL installation directory.


2, specify the character set when exporting, error
Character set ' Utf-8 ' is not a compiled Character set and was not specifie.
--default-character-set=utf-8

This is because the character set is wrong. It's--default-character-set=utf8.


3, the export prompts Warning,a partial dump from A server, which has Gtids
[Email protected] ~]# mysqldump-uroot-p xqsj_db > Xqsj_db20160811.sql
Warning:a partial dump from A server which has gtids would by default include the Gtids of all transactions, even those tha T
Changed suppressed parts of the database. If you don ' t want to restore gtids, pass--set-gtid-purged=off. To make a complete
Dump, pass--all-databases--triggers--routines--events.

With regard to GTID is 5.6, the global transaction ID (GTID) is added to harden the database's primary and standby consistency, fault recovery, and fault tolerance.
Official: A global transaction identifier (GTID) is a unique identifier created and associated with each transaction committed On the origin (master) of the server.
So it may be because it is unique within a database, but it is possible to duplicate it when importing other libraries. All will have a reminder.

You can set these two parameters by adding--set-gtid-purged=off or –gtid-mode=off.
Personally, the Gtid is re-produced in the import library instead of the original.

[Email protected] ~]# mysqldump-uroot--set-gtid-purged=off-p xqsj_db > Xqsj_db20160811.sql #这样就ok了!

Errors when using mysqldump for data export

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.