MYSQL backup and restore (direct copy and use of database files)

Purpose: Transfer the library in machine A to machine B.

1, stop mysql service, in the A machine mysql installation directory, find my.ini file open, in this document to find datadir, the path of the data files: ibdata1 and all folders copied to the B machine d: \ mysql_data Folder (other files are log files, do not copy, these log files depend on the current system, if these log files are copied to the B machine, will be wrong);

2, in the B machine installed in the normal installation mysql.

3, accessories B machine in the mysql server. First close the mysql server. And then open the mysql installation directory, find my.ini file, in this file to the datadir value to the location of the data file d: / mysql_data (note is ‘/’). In the my.ini file, change the default-storage-engine value to myisam because the InnoDB engine does not support direct copying of the data files to the backup database.

4, start the mysql server, this time, the database will become a machine in the A library, so the user name, password is the original.

After the addition and deletion of the test no problem
Reprinted address: https://feetbig.com

Expand the application: you can put a database in the mobile hard disk, so how to where the use of datadir value will be set to move the hard disk data file location can use this backup database.

Related Images

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.