Cold standby method of innodb engine watch
1, environment: 2 servers 222,224, the system is Red Hat Enterprise Linux Server release 5.8. Each of the two servers has several databases. The database dzq on the 222server should be copied to the 224server.
First, change the table under the database dzq on the server to the myisam engine, such as:
Alter table students ENGINE=myisam
Alter table ly ENGINE=myisam
3, and then the mysql service on 222and 224 is turned off / etc/init.d/mysqld stop
4, create the dzq directory under the datadir of the mysql of the 224 server, and then use scp to copy the files under the directory dzq under the mysql datadir directory of the 224 server to the dzq directory of the mysql datadir directory of the 224 server, and change the permissions of the files.
Scp / opt/mysql/data/dzq/* root@192.168.140.224:/var/lib/mysql/dzq
[root@red1 dzq] # chown mysql:mysql db.opt
[root@red1 dzq] # chown mysql:mysql ly.frm
[root@red1 dzq] # chown mysql:mysql ly.MYD
[root@red1 dzq] # chown mysql:mysql students.frm
[root@red1 dzq] # chown mysql:mysql ly.MYI
[root@red1 dzq] # chown mysql:mysql students.MYD
[root@red1 dzq] # chown mysql:mysql students.MYI
5. Open the service / etc/init.d/mysqld start, enter the database, and then change the storage engine back to innodb.
Mysql > alter table ly engine=innodb
Mysql > alter table students engine=innodb