After a day, I finally got it done.
MySQL has two modes: MyISAM and InnoDB.
If MyISAM is used, the. frm. MYD. myi files will be stored in the data directory, so you can directly move the data to restore it After configuring the permissions.
If it is InnoDB, it is quite annoying. There is only. frm in the data directory (this is only a Data Format). After the data is removed, the original data cannot be restored.
The real data is placed in iddata1 under the Data Directory. Therefore, if this file exists, there is still hope to restore it.
But I tried allArticleThe system still prompts "no table in the Database ".
Finally, I found the answer. That is the configuration file of my. ini. There is an item in it:
Innodb_data_home_dir = "C: \ Program Files \ mysql \ MySQL Server 5.1 \ data"
You only need to set the above address as your correct address.
Remember to restart MySQL (enter net stop MySql in cmd, and then Net start MySQL) to restore it...
It took me a day to discover the problem, hoping to help my friends who encountered the same problem.
In summary, it is better to use MyISAM by default for MySQL and it is easy to transfer. Databases are separated from databases and will not be mixed together. So you can set the default items in my. ini:
Default-storage-engine = MyISAM
Good luck !!