你的位置:
问答吧
-> 数据库
-> 问题详情
mysql 启动出现问题.急等解决办法.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
作者: zwangxin
发布时间: 2006-03-16
有人在线吗?帮帮忙.
作者: zwangxin
发布时间: 2006-03-16
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld...failed.
Please take a look at the syslog.
/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!
作者: zwangxin
发布时间: 2006-03-16
你看看配置文件里unixsocket在哪里不行做个ln -s过去
作者: dancingpig
发布时间: 2006-03-17
我看了./var/run/mysqld下面没有mysqld.sock这个文件,是mysql启动时自己生成的.
作者: zwangxin
发布时间: 2006-03-17
mysql服务没有启动,所以连接不上,请检查一下服务是否启动了。
运行
[root@localhost root]# ntsysv
检查里面mysql是否选中
[root@localhost root]# ps -aux|grep mysql
查看是否有mysql进程
作者: fan531
发布时间: 2006-04-04
[root@localhost /]# service mysql stop ##停止MYSQL服务
[root@localhost /]# service mysql start ##启动MYSQL服务
作者: fan531
发布时间: 2006-04-04
[root@localhost /]# service mysql stop ##停止MYSQL服务
[root@localhost /]# service mysql start ##启动MYSQL服务
作者: fan531
发布时间: 2006-04-04
你确定mysqld进程是存在的?
你确定你的my.cnf中的[client]和[server]中的socket 是一致的?
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
作者: cycker
发布时间: 2006-04-04
我也碰到这问题,不过我解决了。我按网上的那些方法都搞了,就是没成功,全部恢复回去后,突然想起我装php的时候有个选项我选否了,具体是那项我忘了,只记得是跟socket有关的,于是打开/etc/php/php.ini,(我用的是arch,可能有的php.ini地址不是这个),搜索socket,在1290行的地方,发现这个“;extension=sockets.so”,把前面的“;”去掉之后,启动mysql,成功了!
作者: jobinson99
发布时间: 2008-10-17