I was copying a folder (database) from mysql server running on windows to a new mysql server running on OpenSuse Linux. When I opened the tables using phpmyadmin, everything was all right. But when I tried to edit the tables this error happened “ERROR 1036: Table ‘xxxxx’ is read only”. It took me a while cause I didn’t know what’s going on.
After reading mysql manual, I finally found the answer. The MySQL server is running as user mysql and not as the user I logged into it with. In order for it to access files that have user only rights they must be owned by user ‘mysql’ since that is what the server is running as. Make sure the folder and files used by mysql belong to the user ‘mysql’. These files are located in the /var/lib/mysql directory. The directory itself should also belong to ‘mysql’.
If you need to make some changes, restart the mysqld service after making them. This makes sense…..
I did not see a fix in the article so I wrote a follow up at http://www.sanguisdevelopment.com/blog/fixing-mysql-error-1036-table-read-only