MySQL常見(jiàn)問(wèn)題及解決辦法
藍(lán)隊(duì)云小課堂:
1.故障一
ERROR 2002 (HY000): Can't connect to local MySQL server through socket/data/mysql/mysql.sock'(2)
問(wèn)題分析:以上這種情況一般都是數(shù)據(jù)庫(kù)未啟動(dòng)或者數(shù)據(jù)庫(kù)端口被防火墻攔截導(dǎo)致。
解決方法:?jiǎn)?dòng)數(shù)據(jù)庫(kù)或者防火墻開(kāi)放數(shù)據(jù)庫(kù)監(jiān)聽(tīng)端口。
2.故障二
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
問(wèn)題分析:密碼不正確或者沒(méi)有權(quán)限訪問(wèn)。
解決方法:
3.故障三
在使用遠(yuǎn)程連接數(shù)據(jù)庫(kù)時(shí)偶爾會(huì)發(fā)生遠(yuǎn)程連接數(shù)據(jù)庫(kù)很慢的問(wèn)題。
問(wèn)題分析:
解決方法:
4.故障四
Can't open file: 'xxx_forums.MYI'. (errno: 145)
問(wèn)題分析:
服務(wù)器非正常關(guān)機(jī),數(shù)據(jù)庫(kù)所在空間已滿,或一些其它未知的原因?qū)?shù)據(jù)庫(kù)表造成了損壞因拷貝數(shù)據(jù)庫(kù)導(dǎo)致文件的屬組發(fā)生變化
解決方法:
修復(fù)數(shù)據(jù)表 (myisamchk、phpMyAdmin)修改文件的屬組
5.故障五
ERROR 1129 (HY000): Host 'xxx.xxx.xxx.xxx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
問(wèn)題分析:
超出最大連接錯(cuò)誤數(shù)量限制
解決方法:
清除緩存(flush-hosts關(guān)鍵字)修改mysql配置文件 (max_connect_errors=1000)
6.故障六
Too many connections
問(wèn)題分析:
連接數(shù)超出MySQL的最大連接限制
解決方法:
修改MySQL配置文件 (max_connections=2000)臨時(shí)修改參數(shù):set GLOBAL max_connections=2000;
7.故障七
Warning:World-writable config file '/etc/my.cnf' is ignoredERROR! MySQL is running but PlD file could not be found
問(wèn)題分析:
MySQL的配置文件/etc/my.cnf 權(quán)限問(wèn)題
解決方法:
chmod 644 /etc/my.cnf
8.故障八
InnoDB:Error: page 14178 log sequence number 29455369832InnoDB: is in the future! Current system log sequence number 29455369832
問(wèn)題分析:
innodb數(shù)據(jù)文件損壞
解決方法:
修改 my.cnf 配置文件 (innodb_force_recovery=4)啟動(dòng)數(shù)據(jù)庫(kù)后備份數(shù)據(jù)文件利用備份文件恢復(fù)數(shù)據(jù)
更多小知識(shí),可聯(lián)系藍(lán)隊(duì)云一起探討。