For some reason, when transferring data from a database, no SQL scripts are exported, and then the pits are not required. However, after a busy afternoon, finally found a way to import the database folder directly into the new MySQL file folder under the data file, you can directly use.
Concrete steps, look down
To stop the MySQL service (net stop MySQL) before the operation, start the MySQL service (net start MySQL) after all operations are completed
(1) Locate the Data folder in the MySQL installation file
(2) Copy the folder in a database under your original data to the data folder in the new MySQL installation file, where the folder name is the name of your database. So it's also possible for you to create a new database. Note also in the data directory to add your original database ibdata1 this file , or you can only look at the name and structure of the table, can not be used.
Note: There is a special pit in this process, even though you can find the Data folder in the MySQL installation file, but when you put the old database folder in, and then use CMD to find the name of the newly placed database, you will find that there is no. That is because although there is a data folder, but this data folder does not work at all, at this time, you can operate, the hidden folder under Windows Display, and then find the Mysql/data, at this time, then put the folder under Data, you can. Can look at the following figure
How to import data into a new database without exporting SQL scripts when MySQL transfers the database