Linux下安装mysql失败,提示找不到mysqld.sock
mysqlstartERROR2002(HY000):Can'tconnecttolocalMySQLserverthroughsocket'/var/run/mysql...
mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
============================================================
我都把目录/tmp或者安装文件的根目录,及var/ 都找过了,都找不到mysqld.sock文件啊.按照官方的步骤来装的就是不行!!!搞了两天了!!! 展开
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
============================================================
我都把目录/tmp或者安装文件的根目录,及var/ 都找过了,都找不到mysqld.sock文件啊.按照官方的步骤来装的就是不行!!!搞了两天了!!! 展开
展开全部
mysql会按顺序读取配置文件/etc/my.conf,/etc/mysql/my.conf,/usr/etc/my.con,~/.my.conf
/etc/my.conf中的
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
和/etc/mysql/my.conf中socket=/var/run/mysqld/mysqld.sock 配置重复,导致/etc/mysql/my.conf中的[client]覆盖了/etc/my.conf中的[client]设置,所以连接不正确,就会出现你说的错误
最简单的办法是删除这个文件
mv /etc/mysql/my.conf /etc/mysql/mysql.conf_backup
/etc/my.conf中的
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
和/etc/mysql/my.conf中socket=/var/run/mysqld/mysqld.sock 配置重复,导致/etc/mysql/my.conf中的[client]覆盖了/etc/my.conf中的[client]设置,所以连接不正确,就会出现你说的错误
最简单的办法是删除这个文件
mv /etc/mysql/my.conf /etc/mysql/mysql.conf_backup
追问
是因为没有启动mysql成功...
追答
把重复的配置文件移除试一下
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询