Home > database >  [for] from A repository to extract mixed format binlog, is there any way to restore A SQL operations
[for] from A repository to extract mixed format binlog, is there any way to restore A SQL operations

Time:09-26

A library is actually ali cloud RDS cloud database, I had A new database on other servers to (B), and then downloaded from ali cloud binlog, restore to B library, then the problem comes, use the command:
 mysqlbinlog -v - base64 - output=decode - dbname mysql rows - d - bin. 000800 & gt; Test. The SQL 

Found after the test. All the insert in the SQL update statement is all comments? Surely this source is not successful, is I use the right way?
/*! The SET @ @ 50530 SESSION. PSEUDO_SLAVE_MODE=1 */. 
/*! The SET @ @ 40019 session. Max_insert_delayed_threads=0 */.
/*! 50003 SET @ OLD_COMPLETION_TYPE=@ @ COMPLETION_TYPE, COMPLETION_TYPE=0 */.
DELIMITER/*! */.
# at 4
# 150623 21:10:10 server id 1154825058 end_log_pos 120 CRC32 0 xc2bbe735 Start: binlog v, 4 v 5.6.16 - log server created 150623 21:10:10
# at 120
# 150623 21:10:10 server id 1154825058 end_log_pos 231 CRC32 0 x7ca67fb2 Previous - GTIDs
# 648 e4 e928c - c587-11-903 - f - ac162d89fd88:1-88450260,
# 72 e4 f39443 - c587-11-903 - f - ac162d8aa4a4:1-6811
# at 231
# 150623 21:10:14 server id 1065724891 end_log_pos 279 CRC32 0 x515d2478 GTID [commit=yes]
SET @ @ SESSION. GTID_NEXT='648 e4 e928c - c587-11-903 - f - ac162d89fd88:88450261'/*! */.
# at 279
# 150623 21:10:14 server id 1065724891 end_log_pos 342 CRC32 0 xe3592098 Query thread_id=8124091 exec_time=0 error_code=0
SET the TIMESTAMP=1435061414/*! */.
The SET @ @ session. Pseudo_thread_id=8124091/*! */.
The SET @ @ session. Foreign_key_checks=1, @ @ session. Sql_auto_is_null=0, @ @ session. Unique_checks=1, @ @ session. The autocommit mode=1/*! */.
The SET @ @ session. Sql_mode=524288/*! */.
The SET @ @ session. Auto_increment_increment=1,. @ @ session auto_increment_offset=1/*! */.
/*! Utf8 \ C *//*! */.
The SET @ @ session. Character_set_client=33, @ @ session. Collation_connection=33, @ @ session. Collation_server=33/*! */.
The SET @ @ session. Lc_time_names=0/*! */.
The SET @ @ session. Collation_database=DEFAULT/*! */.
The BEGIN
/*! */.
# at 342
# 150623 21:10:14 server id 1065724891 end_log_pos 404 CRC32 0 x8a7c8cf6 Table_map: ` mysql `. ` ha_health_check ` mapped to number 755912
# at 404
# 150623 21:10:14 server id 1065724891 end_log_pos 460 CRC32 0 xccd8cdcb Update_rows: table id 755912 flags: STMT_END_F
# # # UPDATE ` mysql `. ` ha_health_check `
# # # WHERE
# # # @ 1=1435061404168
# # # @ 2='m'
# # # SET
# # # @ 1=1435061414704
# # # @ 2='m'
# at 460
# 150623 21:10:14 server id 1065724891 end_log_pos 491 CRC32 0 x4f517162 Xid=102721104
COMMIT/*! */.


Help you, is there any way to SQL extracted with?
Thanks ~

CodePudding user response:

The problem I see you or consult ali cloud, customer service, they know more about your product

CodePudding user response:

You can directly use mysqlbinlog - db dbname mysql - bin. 000800 | B library, can restore your data, a comment because you use the -v this parameter

CodePudding user response:

Dig the grave,
Is ali cloud with the following command, the intention is to provide customers with a view in the binlog save SQL, this command is only used to view the SQL, cannot be used to restore the database, or restore data,
Mysqlbinlog - vv, base64 - output=decode - dbname mysql rows - d - bin. 000800 & gt; SQL
the test.If the test must be used. Restore SQL database, you must delete some beginning annotation symbols, such as sed -i 's/# # # ^//test. The SQL (theory can deal with the test. SQL file, but in fact untested)
Linux users, want to use binlog file restore database, you can refer to man mysqlbinlog, then you will see that the binlog file restore database, it is absolutely cannot use - base64 - output=decode - rows options, mysqlbinlog commands in the help manual with cites the binlog file recovery data sample, as follows:
Mysqlbinlog mysql - bin. 000800 | mysql - uroot -p

CodePudding user response:

No. 1, mysqlbinlog -s parameter binlog & gt; Sql_insert. SQL

2, the source/TMP/sql_insert. SQL
  • Related