2

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.

1 Answer 1

1

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 1 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'.

1
  • thanks for your answer. omg i had just assumed selinux was off, that was it! thanks!! Commented Jun 6, 2015 at 17:28

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.