Remember MySQL data recovery once

Source: Internet
Author: User
Tags table definition

That's more like a data migration.

Background introduction:

Operating system: Windows Server R2

Database version: MySQL 5.5

The installation directory of the database is not the same disk as the data file directory, and the directory disk where the data file resides is corrupted. Data files are then recovered through the data recovery tool. The pre-development colleague tried to start the recovery database, unsuccessfully, and found me after many rounds of unsuccessful attempts.

1. Get the data files from your colleague Ibdata1,mysql installation directory Mysql\mysql Server 5.5. Adjust the My.ini file to try to start the database.

2. Copy the MySQL base dir to the English directory D:\test, and reconfigure the My.ini. The switch directory tries to start.

3. Start another window to try to log in

4. Attempt to skip password verification, set parameter Skip-grant-tables

5. View the database

6. The business library is not found and the user is further viewed.

7. Check the search engine, InnoDB started.

8. Viewing the error log

170121  One: to: -InnoDB:Error:page7 LogSequence Number 1055477743InnoDB: is inchThe future! CurrentSystemLogSequence Number 566049292. Innodb:yourDatabasemay be corruptorcopied the Innodbinnodb:tablespace but notThe InnoDBLogfiles. Seeinnodb:http://Dev.mysql.com/Doc/Refman/5.5/En/Forcing-InnoDB-Recovery.htmlinnodb: forMore information.170121  One: to: -InnoDB:Error:page1 LogSequence Number 1055476531InnoDB: is inchThe future! CurrentSystemLogSequence Number 566049292. Innodb:yourDatabasemay be corruptorcopied the Innodbinnodb:tablespace but notThe InnoDBLogfiles. Seeinnodb:http://Dev.mysql.com/Doc/Refman/5.5/En/Forcing-InnoDB-Recovery.htmlinnodb: forMore information.

9. See the error, log file and data file content does not match. Prove that the data file is read, just, no business user, no table definition. Re-communicate with the report engineer, learned that the business library database named JD, the user is JD. Start feeling there is something wrong, if just innodb data file corruption, Mysql.user should be a user record Ah, suspect this installation directory is not the original MySQL installation directory.

10. Locate the original installation directory and make a directory replacement.

11. The data can be found. Try exporting the data by mysqldump.

Mysqldump--database JD > Jd_db.sql

Then build a new environment, import the database, create a good user, authorization. (The only thing to note is the character set problem)

This completes the entire data recovery effort.

Remember MySQL data recovery once

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.