InnoDB: Running in read-only mode 問題排查

排查方法

1:/var/lib/mysql 文件權限設置

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

運行flush-tables後,read only問題解決:)

2:/etc/my.cnf 文件配置

#直接設置數據庫的可讀性
read_only=0
#在mysql中innodb_force_recovery參數是用來恢復數據庫使用的 掉電恢復時會將innodb設爲只讀
innodb_force_recovery=0

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章