Mysql backup data migration, error handling, mysql backup data
All data files in/usr/lib/mysql are left behind in the project history. Previously, MyISAM engine of mysql5.1 In Debian was used. The current machine is ubuntu, and only mysql5.5 is used. mysql5.6 defaults to InnoDB engine, recovery process.
1. Install mysql5.5 on Ubuntu, copy all data files under/usr/lib/mysql to the corresponding directory in Ubuntu, and set file permissions and owner.
Start sudo service mysql start
Error:/var/log/mysql/error. log file write and creation errors.
To change the default engine from InnoDB to MyISAM, restart the mysql process. Show engines; no good way.
2. Back up the required database from mysql5.1 On Debian and recover from mysql5.5 on Ubuntu.
Mysqldump-u root-p [password] db_something> db_sth. SQL
Error: mysqldump: Got error: 1286: Unknown table engine 'innodb' when using LOCK TABLES
Mysql-u root-p [password]
Use db_something;
Show tables;
Check table one by one: check table table1; until an Error is reported, {Msg_type: Error, Msg_text: Unknown table engine 'innodb' before upt}
Repair table table1; the same error is reported.
My. in cnf, configure datadir and find the files db_things/table1.frm (table format), db_things/table1.MYD (MyData), db_things/table1.MYI (MyIndex) in the directory. Both table1.MYD and table1.MYI are lost. Therefore, repair is unavailable, and myisamchk cannot be used.
Drop table table1;
Mysqldump-u root-p [password] db_something> db_sth. SQL
Obtain the backup file. Table 1 cannot be recovered.