MySQL单实例常见故障汇总
- 故障现象一:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/data/mysql/mysql.sock'
- 故障现象二:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- 故障现象三:在使用远程连接数据库时偶尔会发生远程连接数据库很慢的问题
- 故障现象四:Can't open file: 'xxx_forums.MYI'. (errno: 145)
- 故障现象五:ERROR 1129 (HY000): Host 'xxx.xxx.xxx.xxx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
- 故障现象六:Too many connections
- 故障现象七:Warning: World-writable config file '/etc/my.cnf' is ignored ERROR! MySQL is running but PID file could not be found
- 故障现象八:InnoDB: Error: page 14178 log sequence number 29455369832,InnoDB: is in the future! Current system log sequence number
故障现象一:ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/data/mysql/mysql.sock’
报错:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/data/mysql/mysql.sock’
问题分析:
以上这种情况一般都是数据库未启动或者数据库端口被防火墙拦截导致
解决方法:
启动数据库或者防火墙开放数据库监听端口
故障现象二:ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
报错:ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
问题分析:
密码不正确或者没有权限访问
解决方法:
1)修改 my.cnf 主配置文件,在[mysqld]下添加 skip-grant-tables,重启数据库。最后修改密码命令如下:
mysql> use mysql;
mysql> update user set password=password("123456") where user="root"