For more information, see mysqldump data export.
1. An error (1064) is reported when mysqldump is used. This is because the version of mysqldump is too low and is inconsistent with the current database version.
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 @ bastion-IDC ~] # Mysqldump -- version
Mysqldump Ver 10.13 Distrib 5.1.61, for redhat-linux-gnu (x86_64)
[Root @ bastion-IDC ~] # Mysql // or log on to mysql, select version (); you can also view the version
Server version: 5.6.25-log Source distribution
.....
In this case, you must know the absolute path of mysqldump, which is under the mysql installation directory.
2. Specify the character set during export. An error is returned.
Character set 'utf-8' is not a compiled character set and is not specifie.
-- Default-character-set = UTF-8
This is because the character set is incorrect. Yes -- default-character-set = utf8
3. the prompt "warning, A partial dump from a server that has GTIDs" is displayed during export.
[Root @ bastion-IDC ~] # Mysqldump-uroot-p xqsj_db> xqsj_db20160811. SQL
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that
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.
After GTID is 5.6, a global transaction ID (GTID) is added to enhance the database's master-slave consistency, fault recovery, and fault tolerance capabilities.
Officially given: A global transaction identifier (GTID) is a unique identifier created and associated with each transaction committed on the server of origin (master ).
This may be because it is unique in one database, but it may be repeated when other databases are imported. There will be a reminder for all.
You can set the -- set-gtid-purged = off or-gtid-mode = OFF parameters.
It is very likely that GTID will be re-produced in the import and export warehouse, instead of the original one.
[Root @ bastion-IDC ~] # Mysqldump-uroot -- set-gtid-purged = off-p xqsj_db> xqsj_db20160811. SQL # this is OK!
The above detailed description of mysqldump data export is all the content shared by Alibaba Cloud xiaobian. I hope to give you a reference and support for the customer's house.