Linux MySql 1036 error code resolves of 1036: Table 'xxxx' is read only

  • 2020-06-19 11:54:49
  • OfStack

These two days in the site move, this site move directly packaging mysql database and web file form for migration, upload good mysql data directory of the website database to mysql stored in the database directory on VPS, unzip it. My VPS store database path is/usr/local/mysql/var.

Good website to upload data, extract, configured database link parameters, website can normal connection, I thought this has been the smooth migration is finished, but later operation, found that can only read the database content, can't change in any information, hint # 1036 � Table '*' is read only (* for any table), that is to say, only read-only attribute table.

Give 777 permissions to the database file via SSH, which is my database folder


1 ,  chmod -R 0777 /usr/local/mysql/var/admin/

Change the user and group to MySQL for the database directory


2 , chown -R mysql:mysql admin

But this can't change the database, first of all, find mysqladmin location, 1 kind is below the mysql/bin, I in/usr/local/mysql/bin inside, still need to run the following command:


3 ,  ./mysqladmin -u root -p flush-tables

After that, enter the password of root account, and it will be ready immediately without any prompt. Then test 1, you can read and write normally, and the move will be completed successfully.


Related articles: