First, take a look in the database folder. Does it have a file named ibdata1
? If so, then the news is bad…in all likelihood your database is lost forever.
If it doesn’t have a file names ibdata1
, then your tables are all MyISAM, and you should be able to move the datbase folder to a new MySQL installation. However, you should also move the /data/mysql directory along with your WordPress database directory.
Your attempt #1 does have one problem. The error message references a WordPress953
database, but the folder you said you moved was named wordpress954
. Maybe that is also an issue?
Finally, if you get this fixed, make sure to use phpMyAdmin (or the mysqldump utility) to make a backup of your database!
953 -vs- 954 = typo (sorry)
YES, it does. I have ALL of the files including the ibdata1, ibdata0, .frm, etc. files. In both attempt 1 and attempt 2, I am moving the WHOLE /data folder with all files including the ibdata1 file. In fact, there is a .err file created in attempt1 complaining about the isam id problem in the log file.
It’s simply not working.
In attempt 1, I am NOT moving /data/MySQL. I can try that. However, in attempt 2, I am also moving the /data/MySQL!
It is NOT working in either case. Of course, Attempt 2 might be working but I have no way to start MySQL or login to see the database tables. So who knows in that case. I changed the MySQL root password only about 2 weeks ago so I am 100% correct of what it was and I made the new instance with the same root password.
I’ll retry attempt1 moving both the WP MySQL data folder as well as the MySQL data folder ONLY
If you have an ibdata1
file, that means your tables are InnoDB. While InnoDB has a number of advantages over MyISAM, its biggest disaadvantage is that tables almost never survive a system crash.
You should first go through the /data/mysql.err file (or whatever it’s named in your installation) to see exactly what the problem is. Then read the following documentation that describes the only way you might be able to recover your tables:
https://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
Good luck!
This is NOT a system crash! The hard drive was operating at half speed we believe for some reason so we just moved to a new drive. It was taking 45 mins to reboot and an hour to log in with RDP.
I have ALL the data on the old drive. It is “as if” the mySQL went down for a reboot. No data has changed in the WordPress953 files since 2/22/18 and in the mysql files since 5/31/18 the day before we even had issues. That is the day I changed the root password. It doesn’t make sense to me why I can’t just replace the files and reboot since I have ALL the data. BTW, I have recovered MS SQL and a dozen of other databases like this before no problem and restored 3 MS SQL databases this time as well from just the files.
Attempt 3:
I shut down the mysql server, I put the /mysql and the /wordpress953 folders in the /data folder and the files in the root ibdata1, ib_logfile0, and ib_logfile1 as you indicated. I rebooted the system. I tried to login and I get the same as Attempt 2:
! #1045 Cannot log in to the MySQL server
Where is the root password saved? In ibdata1? I would have thought this is saved in the /mysql. Isn’t that the master tables?
I tried again to reset the password for mySQL but it fails. Here is an image of what I see:

I don’t understand why I can’t reset the mysql password???
Ok, I got it!!
The procedure is.
- Install vanilla mySQL on new server (I had already done that)
- Stop mySQL service
- Move the /data/wordpress953 folder over “intact” “as is”.
- and move ONLY the ibdata1 file and ib_logfiles off of the root over.
- Leave the /mysql data “as is” from the vanilla install
- Start mySQL service
It was basically an “incarnation” of what I was doing but you have to only change certain things. The ibdata1 file in the root went with the /wordpress953 folder but apparently not with anything else.
Ok, it doesn’t look like I am 100% there yet. The database is restored but WordPress is giving the error:
Error establishing a database connection
The issue is I have the “vanilla” /mysql database. When I look at the tables_priv in /mysql it is empty. I’m guessing somehow I need to get the privileges for this WordPress database into /mysql right?