Can't connect to local MySQL server through socket
时间:2009-03-31 来源:arstcmyy
http://hi.baidu.com/smashell/blog/item/4502e644982c7081b2b7dc9f.html
原因是目录 的访问权限问题,ubuntu下用下面的命令(其他发行版用管理员权限,把sudo去掉)
sudo chown -R mysql:mysql /var/run/mysqld
然后启动服务器
sudo /etc/init.d/mysql start
======================================================================/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地址更换后与my.cnf中bind address不一致