Data Recovery after Mysql becomes invalid

Source: Internet
Author: User

This article describes how to recover data after Mysql becomes invalid. In some special cases, the Mysql database becomes invalid and the data cannot be exported. 1. reinstall MySQL locally (Installation Directory D: \ Program Files \ MySQL Server 5.0) and directly copy the mysql folder to D: \ Program Files \ MySQL Server 5.0 \. Result: The database connection is incorrect. 2. after uninstallation, reinstall MySQL and back up the data under D: \ Program Files \ MySQL Server 5.0 \. Only copy all the content in the mysql \ data folder to D: \ Program Files \ MySQL Server 5.0 \ data. Result: The database connection is incorrect. Overwrite the backup data. As a result, the database fails to be connected. 3. after uninstallation, reinstall MySQL and copy the cf1 and last folders (the two are the databases in the original mysql) in the MySQL \ data folder to D: \ Program Files \ MySQL Server 5.0 \ data. The connection is successful. The cf1 and last databases are displayed in Navicat for MySQL, but they cannot be accessed because the data is completely zero. I understand that the file named after the database in the original data stores the table structure of the database, not the metadata. Next, copy the ibdata1 file (3.4G large, obviously storing metadata) in the data folder to D: \ Program Files \ MySQL Server 5.0 \ data, replace the original ibdata1 file. Restart your computer and enable Navicat for MySQL. The connection is successful and data can be accessed. Now, the operation is successful. In fact, it is easier to restore the data on that machine instead of copying the folder mysql directly. However, the machine has reinstalled the system, which means that MySQL is invalid.

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.