/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists
先查看/var/log/mysql.err
发现为空,说明mysql没有起来。
再查 daemon.log
也只提示mysqld错误,
查看syslog 发现如下信息
/usr/sbin/mysqld: Disk is full writing '/var/log/mysql/mysql-bin.000442' (Errcode: 28). Waiting for someone to free space
原来是硬盘空间不足了!
呵呵,mv走一部分log。mysql自动起来了!
类似问题可能也有以下原因
1,目录没有写权限
2,ip地址更换后与/etc/mysql/my.cnf中bind address不一致.修改ip bind. 然后
/etc/init.d/mysql restart
应该可以搞定.
root@jason-Aspire-EC-471G:~# /etc/init.d/mysql restart * Stopping MySQL database server mysqld [ OK ] * Starting MySQL database server mysqld [ OK ] * Checking for tables which need an upgrade, are corrupt or were not closed cleanly.