问题一:
故障现象:ERROR 2002(HY000):Can‘t connect to local MySQL server through socket ‘/data/mysql/mysql.sock’(2)
问题分析:数据库未启动或者数据库端口被防火墙拦截
解决方法:启动数据库或者防火墙开放数据库监听端口
问题二:
故障现象:ERROR 1405(28000):Access denied for user ‘root’@‘localhost’(using password: NO)
问题分析:密码不正确或者没有权限访问
解决方法:
修改my.cnf主配置文件,在[mysqld]字段下添加skip-grant-tables
update更新user表authentication_string字段
重新授权
问题三:
故障现象:在使用远程连接数据库时偶尔发生连接时很慢
问题分析:DNS解析慢,客户端连接过多
解决方法:
修改my.cnf主配置文件(增加skip-name-resolve参数)
数据库授权禁止使用主机名
问题四:
故障现象:Can’t open file:‘xxx_forums.MYI’.(errno:145)
问题分析:
服务器非正常关机,数据库所在空间已满,或一些其他未知原因对数据库表造成损坏
因拷贝数据库导致文件的属组发生变化
解决方法:
修复数据表(myisamchk、PHPMyAdmin-第三方工具)
修改文件的属组
注:myisamchk -r 文件路径
问题五:
故障现象:ERROR 1129(HY000):Host’xxx.xxx.xxx.xxx’ is blocked because of many connection errors; unbo=lock with ‘mysqladmin flush-hosts’
问题分析:
超出最大连接错误数量限制
解决方法:
清除缓存(flush-hosts关键字)
修改mysql配置文件(max_connect_errors=1000)
问题六:
故障现象:Too many connections
问题分析:
连接数超出mysql的最大连接限制
解决方法:
修改mysql配置文件(max_connect=1000)
临时修改参数
问题七:
故障现象:Warning: World-writable config file ‘/etc/my.cnf’ is ignored ERROR! MySQL is running but PID file could not be found
问题分析:
MySQL 的配置文件/etc/my.cnf权限问题
解决方法:
chmod 644 /etc/my.cnf
问题八:
故障现象:
Innodb:Error:page 14178 log sequence number 29455369832
Innodb:Error:is in the future! Current system log sequence number 29455369832
问题分析:
innodb数据文件损坏
解决方法:
修改my.cnf配置文件(innodb_force_recovery=4)
启动数据库后备份数据文件
利用备份文件恢复数据