The elimination of Table is read only in the MySQL database

Source: Internet
Author: User

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

 
 
  1. 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

 
 
  1. Hi,   
  2. I just encountered a similar problem on one of my production servers   
  3. this morning. (I'm still investigating the cause.) After doing a   
  4. quick bit of Google-searching, this solved my problem:   
  5. MySQLadmin -u <username> -p flush-tables   
  6. By the way: All directories in /var/lib/MySQL should have 700   
  7. permissions (owned my the MySQL user) and everything within those   
  8. directories should be 660 (owned by the MySQL user and MySQL group).   
  9. (This was on a FreeBSD 4.8 server running MySQL Server 3.23.58)   
  10. Hope this helps,   
  11. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.