ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysq
Posted 花儿为何那样红
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysq相关的知识,希望对你有一定的参考价值。
1876 ? 00:00:31 mysqld
先查看 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已经启动.
另外看看是不是权限问题.
------------------------------------------------------------------------------------
[[email protected] beinan]#chown -R mysql:mysql /var/lib/mysql
[[email protected] beinan]# /etc/init.d/mysqld start
启动 MySQL: [ 确定 ]
[[email protected] lib]# mysqladmin -uroot password ‘123456‘
[[email protected] lib]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 3 to server version: 4.1.11
Type ‘help;‘ or ‘/h‘ for help. Type ‘/c‘ to clear the buffe他的也解决了,我的麻烦还在继续,依然继续寻找
问题解决了,竟然是max_connections=1000 他说太多了,然后改成500也说多,无奈删之问题解决了。还是不行
摘要:解决不能通过mysql .sock连接MySQL问题 这个问题主要提示是,不能通过 ‘/tmp/mysql .sock‘连到服务器,而php标准配置正是用过‘/tmp/mysql .sock‘,但是一些mysql 安装方法 将 mysql .sock放在/var/lib/mysql.sock或者其他的什么地方,你可以通过修改/etc/my.cnf文件来修正它,打开文件,可以看到如下的东东:[mysql d]
socket=/var/lib/mysql .sock
改一下就好了,但也会引起其他的问题,如mysql 程序连不上了,再加一点:
[mysql ]
socket=/tmp/mysql .sock
或者还可以通过修改php.ini中的配置来使php用其他的mysql .sock来连,这个大家自己去找找
或者用这样的方法:
ln -s /var/lib/mysql /mysql .sock /tmp/mysql .sock成功了,就是这样ln -s /var/lib/mysql /mysql .sock /tmp/mysql .sock
OK!
以上是关于ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysq的主要内容,如果未能解决你的问题,请参考以下文章
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' 。安装后出错
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) on Mac
FreeBSD ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket'/var/run/mysqld/mysqld.sock'
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when I
尝试了一切仍然得到 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (