I have a database folder from a crashed server called gain_wordpress. I'm trying to put that database on a new server but I'm not able to do it successfully. I don't have a .sql dump, all I have is the database folder from a past crashed server with ibdata and the 2 log files.

I copied the gain_wordpress folder to /var/lib/mysql on the new server but when I do a > show tables on the database I get the following error:

ERROR 1018 (HY000): Can't read dir of './gain_wordpress/' (errno: 13)

I also changed the permission of the folder and did a chown mysql:mysql gain_wordpress -R and it still didn't take care of the problem.

What is the best way to recover gain_wordpress. Do I need to replace any of the ibdata or the logfiles? What is the best way? I have the corresponding .frm, .MYD and .MYI files for each table. Please advise.

1 Answer 1


you need to make sure the ownership and privileges are correct for the directory, you can use the following commands to set it right:

chown -R mysql:mysql /var/lib/mysql/ --your mysql user may have different name, if its different you need to change it [mysql:mysql] as needed 
chmod -R 755 /var/lib/mysql/

note: -R: recursive fir the directory and all its contents.

  • The permissions for the mysql user and group on file level are generally -rw-rw---- which corresponds to 0660. I'd perform the chmod from the gain_wordpress directory downwards (chmod -R 0660 /var/lib/mysql/gain_wordpress).
    – John K. N.
    Jun 14, 2017 at 6:36

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.