I have a wordpress site on a server that had a failing HD. The drive went to read-only and I was able to copy off the mysql database files. When I put those files onto another server and brought the site up, I'm seeing a ton of errors in the web server log about tables being read-only.

What I've tried that has not resolved it:

changing ownership to mysql:mysql (was already that way anyway)
stopping and starting mysql
repairing the tables -> gave a bunch of errors such as
error : Table 'ccon.wp_bwwc_btc_addresses' is read only

Did not try rebooting the whole system. Not sure what else I should try - they're still read-only. Appreciate any suggestions, thanks.

Created a new database, copied the table as per the first answer here: Linux / mysql: is it safe to copy mysql db files with cp command from one db to another? made sure that copied table was writable, copied the files over the existing tables and it was no longer writable.

seems like there must be a ro flag set on the whole db or something? I guess one solution will be to copy all the tables into a new db and scrap the old db.


Login as root. Ensure that the permissions are appropriate.

sudo chown -R mysql:mysql /var/lib/mysql
chmod 755 /var/lib/mysql

Validate the 'user' privileges (from mysql prompt):

select * from information_schema.user_privileges where grantee like "'user'%";

Last, but not least, check the SELinux status and disable temporally if is enabled:

cat /selinux/enforce 

echo 0 > /selinux/enforce

Reboot MySQL:

sudo service mysql restart

To make selinux permanently disabled, set the SELINUX variable in the /etc/selinux/config file to 'disable'.

  • thanks for your answer. omg i had just assumed selinux was off, that was it! thanks!! – user16081-JoeT Jun 6 '15 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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