MySQL Backup data migration, error handling

Source: Internet
Author: User
Tags error handling mysql backup

Project History Legacy/usr/lib/mysql all data files, before using Debian under the mysql5.1 MyISAM engine, now the machine is Ubuntu, only the mysql5.5,mysql5.6 default InnoDB engine, the process of recovery.


Install mysql5.5 on 1.Ubuntu, copy all data files under/usr/lib/mysql to the corresponding directories in Ubuntu system, and set file permissions and owner.
Start sudo service MySQL start
Error,/var/log/mysql/error.log all kinds of file write, create errors.
Turning the default engine from InnoDB to MyISAM requires a reboot, and the MySQL process restarts unsuccessfully. Show engines; There is no good way.


2. mysql5.1 backup required database from Debian, mysql5.5 recovery on Ubuntu.


Mysqldump-u Root-p[password] Db_sth > Db_sth.sql
Error: Mysqldump:got error:1286:unknown table engine ' InnoDB ' when using LOCK TABLES


Mysql-u Root-p[password]
Use Db_sth;
Show tables;


Check Table:check table table1; Until error, {msg_type:error, Msg_text:unknown table engine ' InnoDB ' corrupt}
Repair table table1; The error is the same.


MY.CNF configuration DataDir, look for the directory under the file Db_sth/table1.frm (table format), Db_sth/table1. MYD (MyData), Db_sth/table1. MYI (Myindex), found Table1. MYD and Table1. MYI have been lost. So it cannot be repair and command myisamchk is not available.


drop TABLE table1;
Mysqldump-u Root-p[password] Db_sth > Db_sth.sql
Get the backup file. Table1 This table cannot be recovered.

MySQL Backup data migration, error handling

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.