以下的文章主要介紹的是MySQL Table is read only的具體解決方案,前幾天我們遇到了這樣的一個提示,即repair數據表運行的時候“MySQL Table is read only”的出現,在MySQL中,Select之類的都正常,但在網頁程序中提示:Table '********' is read only。
SQL代碼
- chmod -R 0777 /var/lib/MySQL/taoniu2007/
給數據庫目錄的所屬用戶和組改為MySQL,並加上777的權限,還是一樣提示。
程序中使用root連接,也是一樣的提示。
想用myisamchk來檢查一下,也提示read only。
最終在這裡找到了解決方法
引用一下
SQL代碼
- 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
以上的相關內容就是對MySQL Table is read only的解決的介紹,望你能有所收獲。