The following article mainly introduces the specific solution of MySQL Table is read only. We encountered such a prompt a few days ago, that is, when the repair data Table is running, "MySQL Table is read only" appears. in MySQL, Select and other operations are normal, but the webpage program prompts: table '********' is read only.
SQL code
- chmod -R 0777 /var/lib/MySQL/taoniu2007/
Change the user and group of the database directory to MySQL, and add the 777 permission.
The same is prompted when the root connection is used in the program.
If you want to use myisamchk to check it, the read only message is also displayed.
Finally, the solution is found here.
Reference
SQL code
- Hi,
- I just encountered a similar problem on one of my production servers
- this morning. (I'm still investigating the cause.) After doing a
- quick bit of Google-searching, this solved my problem:
- MySQLadmin -u <username> -p flush-tables
- By the way: All directories in /var/lib/MySQL should have 700
- permissions (owned my the MySQL user) and everything within those
- directories should be 660 (owned by the MySQL user and MySQL group).
- (This was
The above content is an introduction to the MySQL Table is read only solution. I hope you will have some gains.