1

I did a backup of the data folder from mysql server to keep all databases information.

C:\ProgramData\MySQL\MySQL Server 5.7\Data

I uninstalled MySQL server in Control Panel. I copied the data folder and pasted it back where it should be.

I am then trying to reinstall the service using MySQL installer. However, it is stuck on Starting Server... forever and sometimes will pop a message saying it is taking too long than expected. I tried this solution but it does not work for me.

When I remove the ibdata1, Mysql server installs, starts and runs. However, whenever I try to run a query on a table I get database_name.table does not exist.

Clearly to me the problem is ibdata1... So what should I do, if I really need to restore all the databases?

1 Answers1

3

Do you still keep ibdata1 ? Reclean and copy back your ibdata1 and your data

For starting mysql, you should config Innodb force recovery (increase this value from 1 to 6). This will give you detail information https://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html

Remember, in recovery mode you can read data only and cannot update, insert or delete

Update: Find your my.ini (on linux my.cnf) add this line to your [mysql]

innodb_force_recovery = 1

Try to increase it from 1 -> 6 until you can start your mysql server. Then you can perform dump to backup your server remember you cannot update/insert/delete in recovery mode

Bùi Đức Khánh
  • 3,975
  • 6
  • 27
  • 43
  • Thanks for answering. I dont understand? Please more details. –  Nov 27 '17 at 23:10
  • Ok thank you. What do you mean dump? I dont have .sql file. I have copied Data folder. You mean to place it back? –  Nov 27 '17 at 23:37
  • Your data may be corrupted and it is not good to continue using it. If now you can start your server you should dump (mysqldump) your db to sql file. Then clean everything and restore your db from sql you dump before – Bùi Đức Khánh Nov 27 '17 at 23:40
  • Using mysqldump and succesful dump your db. It will backup all your database include your client information to file and you can using it to restore everything information – Bùi Đức Khánh Nov 27 '17 at 23:48
  • A HDD file system error affected my ibdata1 file (or the intense usage of my MySQL caused the HDD crash?), prognosing the complete loss of my Redmine database. I wasn't even able to make a copy of the ibdata1 file, and I didn't have any recent backups. Somehow I managed to fix the file system, but the MySQL wasn't able to keep stable: it was continuously writing into the error log. Finally the iteration of innodb_force_recovery to the value of 4 helped me to use mysqldump. :) Many thanks! – cinemazealot May 28 '21 at 21:31