How to call the previous MySQL data after reloading the system

Source: Internet
Author: User

The premise is that the previous database data must be retained

Before introducing this method, it is advisable to remind you that the best way to transfer data is:

Export the SQL file in the original MySQL server, and then import the data in the new MySQL server.

First, the MySQL storage data principle:

MySQL storage data is not the same as SQL Server (a data file, a log file). When MySQL creates a new database, create a folder with the name of the database under the Data folder for the database, note that this folder is only the table structure of the database, and does not store the data in it. Where's the data? There is a ibdata1 under the Data folder to see the size of this file, you see, MySQL stores all the data in this file.

To recover data methods:

Know the above principle, the recovery data should know how to do, because we think that MySQL is the same as SQL Server storage data, so we directly to the original database is located in the folder to the data directory, because there is no copy data, so MySQL prompts you data does not exist, Then the ibdata1 this file to copy the past, OK.

Operation Method:

1. Copy the Data folder from the original MySQL installation directory;

2, copied out of the data folder, in addition to MySQL, test subfolders outside the subfolder, all are databases, as shown in all are a database;


This is where you can put your table structure in the new database, but when you open the table you will be prompted " data table does not exist "This is because the ibdata1 of the stored data is not in the lead.

3, you turn off the MySQL service (if you do not close, you will be prompted to Ibata1 by the program, unable to overwrite), and then replace the previous database ibdata1, and then restart the service, you can find the table.

This is Baidu to: Method two: MySQL to replicate data folder content recovery

1. Locate the MySQL installation directory under the bin directory with a Mysqld-nt.exe
2. Then run cmd into the bin directory of MySQL to play mysqld-nt install enter service on installation work
3. Then run the input services.msc to get the MySQL service back up.
This will make your database and System Restore exactly the same as before.


How to call the previous MySQL data after reloading the system

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.