对MySQL数据库中Table is read only的歼灭

在实际操作中你是否遇到过这样的提示,repair数据表中出现“MySQL数据库中Table is read only”的字样,那么对其到底如何解决呢?以下的文章就是针对MySQL数据库中出现Table is read only的解决方案的描述。

在MySQL中,Select之类的都正常,但在网页程序中提示:Table '********' is read only

SQL代码

 
 
 
 
  1. chmod -R 0777 /var/lib/MySQL/taoniu2007/  

给数据库目录的所属用户和组改为MySQL,并加上777的权限,还是一样提示。

程序中使用root连接,也是一样的提示。

想用myisamchk来检查一下,也提示read only。

最终在这里找到了解决方法:http://www.MySQLtalk.org/re-the-table-is-read-only-vt154092.html

引用一下

SQL代码

 
 
 
 
  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   

运行flush-tables后,read only问题解决

以上的相关内容就是对MySQL数据库中Table is read only的解决的介绍,望你能有所收获。

【编辑推荐】

  1. MySQL导出 XLS 数据库工具的实际操作
  2. 对MySQL行锁的深入研究
  3. MySQL游标的使用笔记大全
  4. 对MySQL 存储过程中乱码的破解
  5. MySQL备份之根据表备份概述
THE END