Help Center/ GaussDB(for MySQL)/ Troubleshooting/ Backup and Restoration Issues/ SQL Statements Such as SET @@SESSION.SQL_LOG_BIN Displayed After You Run mysqldump
Updated on 2024-09-05 GMT+08:00

SQL Statements Such as SET @@SESSION.SQL_LOG_BIN Displayed After You Run mysqldump

Scenario

When you run mysqldump on a newly purchased Huawei Cloud database, the following code is displayed.
Figure 1 Code

Fault Analysis

The parameter gtid-mode is set to ON.

If GTID is enabled for a database, you can use mysqldump to back up or dump all Global Transaction Identifiers (GTIDs) in the database or even to back up the whole MySQL database.

Solution

When GaussDB(for MySQL) databases are exported for backup and restoration, check whether GTID is enabled.

If GTID is enabled, add –set-gtid-purged=OFF to the mysqldump command during data dump.