Restoring MySQL Databases when reinstalling Wamp

有些话、适合烂在心里 提交于 2019-12-04 09:57:57

If you created an INNODB database, and made no other config changes to store the actual data in seperate table spaces then all the actual data for that INNODB databases will have been stored in the \wamp\bin\mysql\mysql5.6.17\ibdata1 file.

If you do not have that file from the old install then your data is lost.

There will also be info in a \wamp\bin\mysql\mysql5.6.17\data\DATA_BASE_NAME\ folder, one .frm file for each table that was in the database, but this is basically just schema information and not actual data.

For future reference, InnoDB Backup and Recovery

GOLDEN RULE:

Always backup database (from phpmyadmin) before major changes.. better to spend 1 minute for that, than going into trouble..

How to Copy data folder

If you want to copy the database, then INSTALLATION/mysql versions should be same.. then rename newly installed data folder to i.e. data_my_old,so now there you can place the backuped data folder (it should contain ibdata1 file).

Depends on innodb_file_per_table setting.

If it was OFF then all your tables were in ibdata1. Now you have quite new ibdata1 (since you see errors "Cannot open table testdb/users from the internal data dictionary", that means InnoDB runs fresh new dictionary). That means that now the data is somewhere on the disk. The recovery is quite difficult and requires a lot of tedious work. You need to take an image of the disk, scan it with stream_parser to find InnoDB pages, then recover the InnoDB dictionary, then find index_id of every table and if the stream_parser has found this index run c_parser to extract records from the index.

If innodb_file_per_table was ON and you do see .ibd files in the databases directories then recovery is much easier. First, you may try to reconnect individual ibd files with ibdconnect or extract records from the ibd files with stream_parser/c_parser.

The mentioned tools are part of TwinDB data recovery toolkit

You might check it :--- default-character-set=latin1 default-collation=latin1_swedish_ci

inside a .opt file inside same folder which is optional file but tells about character-set. There may be problem caused by mismatch of target and source character set.

i have just done a google search and found this....

Go to C:\wamp\bin\mysql\mysql5.5.24\data

Find a file called "mysql-bin.index"

Rename that file to "mysql-bin.index-corrupt"

Restart the server and it will work fine, all your database will be where you left them.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!