mariadb报:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")

我这边移除了mysql.sock文件后,重启服务就成功了。

还有一种情况,就是加入galera后,可能是server.cnf配置信息出了问题导致的,修改后,重新运行galera即可,数据库就可以启动成功了。

mariadb报:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")

原文地址:https://www.cnblogs.com/zhongjicainiao/p/10931946.html

时间: 2024-11-06 03:36:57

mariadb报:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")的相关文章

连接数据库报错:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

报错: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 1.楼主是新安装的mysql,注意新安装完成不会默认启动服务 2.百度上各种处理办法均不对,查看数据库状态发现未启动!!! 3.重启把服务拉起即可成功连接:systemctl start mariadb.service 4.安装新服务后一定要先检查服务的状态信息,再去判断报错!!! 连

长久不用的mysql报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

mac上安装过mysql: 然而,尝试连接时报错: $ mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 尝试去查看mysql.socket文件,发现没有.. $ which mysql /usr/local/bin/mysql 然后试试重启mysql: $ mysql.server start

mac 安装mysql 报错“ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock' (2)” 解决办法

首先安装 homebrew 再 brew install mysql 之后连接 mysql 无论是登录还是修改初始密码都会报如下的错误 ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock' (2) 运行如下解决:参考 http://www.thinksaas.cn/group/topic/347978/ unset TMPDIR mysql_install_db --v

Mac brew 安装mysql 报错 ERROR 2002 (HY000): Can't connect to local MySQL server through socket

安装mysql 最新版 56 brew install mysql 启动报错 ben:~ soul$ which mysql /usr/local/bin/mysql ben:~ soul$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 解决办法 运行 ben:~ soul$ mysql.server start Starting MySQL .

MySQL登录报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

[[email protected] mysql3307]# /opt/mysql3307/bin/mysql -upisp [email protected]123 mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.so

【Problem】xampp in ubuntu下命令行启动mysql报错: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)

xampp in ubuntu下命令行启动mysql报错: [email protected]:/opt/lampp$ ./bin/mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2) 启动mysql服务: [email protected]:/opt/lampp$ /

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var mysql 启动不了

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var mysql 启动不了 ps -A | grep -i mysql kill 列出来的进程 service mysql start 我的问题就解决了 ---------------------------------------------- Fedora8启动mysql 报错:ERROR 2002 (HY000): Can’t connect

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

我在源码编译安装mysql后,虽然mysql服务可以正常启动,但是当我直接执行mysql后,出现了错误. 错误提示如下: [[email protected] ~]# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 出现错误原因: 由于mysql 默认的mysql.sock 是在/var/lib/mysql/mysql.sock,但linux系统总

安装mysql后ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var mysql 启动不了

ps -A | grep -i mysql kill 列出来的进程 service mysql start 我的问题就解决了 ---------------------------------------------- Fedora8启动mysql 报错:ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) 1.先查看 /etc/rc.d/ini