I dont know anything about databases or MySQL beyond the absolute basics so lets start with that. I moved the /var/lib/mysql from the / to a mounted volume which I remounted as /var/lib/mysql after moving the files to temp storage.

Ok, now when I go to my sites, its like they dont have any database attached to them. Wordpress wants to reinstall, other sites cant connect to their databases either.

When I go to the file system directly (/var/lib/mysql) and look for the files, I see that they are in their respective directories (I even restored from a backup just to be extra sure the files were there).

I have tried to repair and check the tables. But it keeps saying that some of the tables dont exist.

I am totally lost and frustrated.

  • To start with, I'd suggest looking in the error log and then updating your question. The error log will most likely be in either /var/log/mysql or /var/lib/mysql. Commented Sep 27, 2014 at 12:38
  • The log files are empty.
    – user12920
    Commented Sep 27, 2014 at 16:05
  • They shouldn't be empty if MySQL is starting. Can you log into MySQL? Does SHOW VARIABLES LIKE 'log_error' point to the name of an empty file? Do you get any error output if you try to restart MySQL? Commented Sep 27, 2014 at 17:46

1 Answer 1


Ok, after about a billion headaches I finally figured out what was wrong. Here it is: Some tables are MyISAM and some are InnoDB. I didnt know that when I started, which would have totally helped. So, what ended up happening is that when I moved the files to a temp directory, I guess I messed up the InnoDB tables alignment or whatever you call it, anyway the results where that all the sites that were InnoDB didnt work because I didnt do proper InnoDB moving and it couldnt find those tables.

So what I eventually realized is that I had been making backups of the database and that I could probably restore the database and get the InnoDB tables back inline where they should be. So what I ended up doing was mounting a new disk at /var/lib/mysql and then restoring the databases from a backup onto the new filesystem that was mounted for /var/lib/mysql.

Once that was done, I restarted MySQL and it is now running like nothing ever changed. Geesh.. what an adventure!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.