Scenario One: (Don't change too much My.ini file)
Copy the database from the original database a ib_logfile1 ib_logfile0 ibdata1;
Close the destination database B;
Backup destination database b ib_logfile1 ib_logfile0 ibdata1 three files to prevent the database from being used after the change;
Copy to the original database a ib_logfile1 ib_logfile0 ibdata1 placed in the destination database b corresponding location, if your destination database ib_logfile Two files size and copy to the same file size, paste directly can;
Restart database b
Scenario Two: (Need to change My.ini file)
Copy the database from the original database a ib_logfile1 ib_logfile0 ibdata1;
Close the destination database B;
If the size of the Ib_logfile two files in database B is different from the size of the copy file, the Ib_logfile1 Ib_logfile0 ibdata1 three files in database B of the backup destination, prevent the database from being used after the change, and delete the I under the destination database. B_logfile1 the Ib_logfile0 file, change the innodb_log_file_size in the My.ini file to the Ib_logfile1 ib_logfile0 file size in the original database eg. innodb_log_file_size=90m;
Restart database B;
After success, delete Ib_logfile1 ib_logfile0 that restarted database B, paste the copy ib_logfile1 ib_logfile0 (or replace the existing database with copy's Ib_logfile1 IB_LOGFILE0). b in the Ib_logfile1 IB_LOGFILE0 can be);
Paste the database ibdata1 to the appropriate location;
Restart database b
PS: The purpose is to ensure
1, database Ib_logfile1 IB_LOGFILE0 ibdata1; must be copied at the same time, that is, you can not copy the process of other operations to manipulate the database you want to copy. (The data copied may have crash)
Transferred from: http://my.oschina.net/u/1462678/blog/223646
Copy MySQL database A to another MySQL database B (only for INNODB database engine)