About Mysql Data Migration--data directory of direct replacement considerations _mysql

Source: Internet
Author: User
Recently replaced the server, to do the database migration, the data in the database from server A to Server B.
Because of the large amount of data, it takes too long to make the dump directly, so it is handled as follows:
First of all, on Server B installed with the server A version of MySQL, stop the MySQL service, will be installed after the Data directory deletion;
Then, server a locks up all tables, removes the entire data directory and data files from server A to copy to Server B, modifies the datadir in MySQL's my.cnf file on Server B to point to the new data directory.
Finally, start the MySQL service on Server B.
The result failed to start, reported "Unable to start the MySQL service" exception, view the error log, and found the problem described as follows:
InnoDB:Error:log file./ib_logfile0 is of different size 0 63963136 bytes
Innodb:than specified in the. cnf file 0 6291456 bytes!
This information means that the log file is larger than the log file quota set in MY.CNF and the service does not start. The reason is that the log file is copied from server A, and the log quota in my.cnf on Server A is larger than the MY.CNF log quota on Server B.
Calculate log file Size: 63963136/(1024*1024) =61m,6291456/(1024*1024) =6m, no wonder?
Set the Innodb_log_file_size parameter in my.cnf on Server B to 61M, start MySQL again, and start successfully.

The summary needs to note the matter:
1. Modify DataDir to the new data directory.
2. Reasonable modification of the Innodb_log_file_size value for the actual migrated log file size.
3. Character Set/default engine modification, to be unified before migrating.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.