I originally installed MySQL on the d disk. The system has been reinstalled recently and cannot be used. What should I do? How can I continue using MySQL and transfer the original data to the newly installed MySQL?
1. copy the data folder in the original MySQL installation directory;
2. Uninstall the original MySQL instance;
3. reinstall MySQL;
4. In the copied data folder, all subfolders except MySQL and test are databases, as shown in. Europa, outman, sd1004db, and shtarena are all databases;
5. Create the above database in the newly installed MySQL; I have now created the Europa database;
6. copy the files in the above Europa folder to the Europa folder under the newly installed MySQL directory;
7. When you use the Europa database, a table is displayed;
You can search for this table, and the system prompts that the table does not exist.
8. After the MySQL service is restarted, the problem persists;
9. You forgot to copy the ibdata1 file in the original data folder. If you copy this file directly, you will be prompted that a file is in use. Go to the service, close the MySQL service, and then copy the file to the data folder. Then enable the MySQL service. Then you can query the m_cost table in the Europa database. No error is reported, and all the previous data is there.
The data folder in the MySQL installation directory stores Mysql Data. Each sub-folder in the data file corresponds to each database in MySQL. The. frm file in the subfolder corresponds to the corresponding table. DB files are character set configuration files. With these files, you can restore the data. You also need the ibdata1 file in the data folder.