In Linux, how does one solve the #1036-Table ''is read only error in MySql,
This article is for Reprinted content. Thanks to the original author. From: http://zhaoxiaoru39.blog.163.com/blog/static/609552192012511104730115/
The problem I encountered was that in navicat mysql, data was transmitted from a mysql Server (formally) to another server (simulating a database ). Is the whole database transmission. Rename the data folder of a database in the simulated database, create a new database, and then transmit data. After the transfer is complete, it is found that the table of the database created on the simulation is changed to read-only. The problem is solved by following a similar step in the following article.
During the past two days, the website was migrated in the form of directly packing mysql databases and web files, upload the website database in the mysql data DIRECTORY to the directory where mysql stores the database on VPS, and decompress it. The path for storing my VPS database is/usr/local/mysql/var.
Upload the website data, decompress it, and configure the database link parameters. The website can be connected normally. I thought this was completed successfully, however, during subsequent operations, I found that I could only read the database content and could not write any information. The message #1036-Table '*' is read only (* indicates any Table) was prompted ), that is to say, the table only has read-only attributes.
Use SSH to grant database file 777 permissions. admin is my database folder.
Step 1: chmod-R 0777/usr/local/mysql/var/admin/
Change the user and group of the database directory to MySQL.
1 Step 2: chown-R mysql: mysql admin
However, you cannot change the database. First, find the location of mysqladmin, which is usually under mysql/bin and in/usr/local/mysql/bin, you also need to run the following command:
1 Step 3:./mysqladmin-u root-p flush-tables
Then, enter the password of the root account. It will be ready immediately without any prompts. Then, test whether the database can be read or written properly and the migration will be completed smoothly.