MySQL error #1036 – Table is read only

You may receive the following error while repairing or optimizing the MySQL tables:

#1036 – Table ‘xyz’ is read only

When the MySQL tables are in “read only” status, you can update or insert any data in them. In most cases this happens due to incorrect ownership for mysql data directory or data files. The ownership of the mysql director and data files must be mysql:mysql. To correct the ownership, you can run the following command via SSH:

chown -R mysql:mysql /var/lib/mysql

If MySQL data are not stored in /var/lib/mysql, you will need to update this path as per your installation. After changing the ownership, you will need to restart MySQL service:

service mysql restart

-OR-

/etc/init.d/mysql restart

This should fix the “read only” status.

1 Comment

  1. […] [4] You can face this problem if your MySQL tables are in read-only status. For more details to resolve MySQL read-only status, please refer our article MySQL error #1036 – Table is read only. […]

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to top
%d bloggers like this: