The database to be migrated is as follows:
Mysql>show databases;+--------------------+| Database |+--------------------+|Information_schema||Forbk||Hive||Mysql||Test|+--------------------+5Rowsinch Set(0.00sec) MySQL> UseFORBKDatabaseChangedmysql> Create Table' Back_table ' (xintYint); Query OK,0Rows Affected (0.01sec) MySQL> Insert intoBack_tableValues( A, -); Query OK,1Row affected (0.00sec) MySQL> Select * fromback_table;+------+------+|X|Y|+------+------+| A | - |+------+------+1Rowinch Set(0.00sec) MySQL>
To migrate the database configuration as follows, you can find the MySQL data file stored in: Datadir=/var/lib/mysql
[Mysqld]datadir=/var/lib/Mysqlsocket=/var/lib/mysql/Mysql.sockuser=Mysqlcharacter_set_server=Utf8init_connect='SET NAMES UTF8'# Disabling Symbolic-links are recommended to prevent assorted security riskssymbolic-links=0[Mysqld_safe]log-error=/var/log/Mysqld.logpid-file=/var/run/mysqld/Mysqld.pid[mysql]default-character-set=Utf8#bin-Long=justin-bin "/etc/my.cnf" 16L, 364C
Now migrate the Forbak library of this database to another machine:
Copy the/var/lib/mysql/forbk file directly to the DataDir directory of another machine,
Without restarting the MySQL service, you can dynamically see that the FORBK Library has been successfully migrated to the target machine:
Note: Backing up the database by copying files is not documented in Binlog. However, when the backup is completed, the Update,insert and delete operations of the backed up libraries will trigger binlog;
MySQL Data migration