[Solved] Backup mysql8.0 with the mysqldump of mysql5.7 Error

Use mysql5 The mysqldump command of version 7 backs up mysql8 An error will be reported when using the 0 version of the database:

mysqldump: Couldn't execute 'SET SQL_QUOTE_SHOW_CREATE=1/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */': Variable 'sql_mode' can't be set to the value of 'NO_KEY_OPTIONS' (1231)

The solution is as follows:

The first way is to upgrade MySQL 5 Version 7 database to MySQL 8.0 0, and then use the same command to back up

The second way is not to use MySQL 5 Version 7 database comes with the mysqldump command, but find a mysql8 Upload the mysqldump command file of version 0 database to the specified path of the host, and then use mysqldump under this path for backup operation

The second method is recommended

View the current mysqldump version command

# mysqldump --version
mysqldump  Ver 10.13 Distrib 5.7.35, for Linux (x86_64)

# mysqldump --version
mysqldump  Ver 8.0.25 for Linux on x86_64 (MySQL Community Server - GPL)

Similar Posts: