In practice, have you ever encountered such a prompt that the "Table is read only" in the MySQL database appears in the repair data Table? How can this problem be solved? The following article describes the solutions for Table is read only in the MySQL database.
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 found the solution: http://www.MySQLtalk.org/re-the-table-is-read-only-vt154092.html
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 on a FreeBSD 4.8 server running MySQL Server 3.23.58)
- Hope this helps,
- Seth
Read only Problem solved after flush-tables is run
The above content is an introduction to the solution of Table is read only in the MySQL database. I hope you will have some gains.