博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ERROR 2002 (HY000): Can't connect to local MySQL错误
阅读量:7233 次
发布时间:2019-06-29

本文共 808 字,大约阅读时间需要 2 分钟。

hot3.png

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

最后发现在my.cnf配置文件中,有一行绑定IP的没有修改,还是原来的IP,把它修改成当前mysql服务器的IP,重启服务(sudo service mysql restart),即可,用回环地址(127.0.0.1)和localhost,远程的客户端便访问不到,不知为什么。比如我的是私网地址192.168.31.245,直接bind-address = 192.168.31.245

############################################################################

这个并不好使?

34        down vote

I got the following error

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

Tried several ways and finally solved it through the following way

sudo gksu gedit /etc/mysql/my.cnf

modified

#bind-address       = 127.0.0.1

to

bind-address        = localhost

and restarted

sudo /etc/init.d/mysql restart

it worked

转载于:https://my.oschina.net/airship/blog/612787

你可能感兴趣的文章
备忘录模式
查看>>
支付宝支付功能开发简易流程
查看>>
【服务器环境搭建-Centos】常用系统命令篇
查看>>
Swift用UIBezierPath来画圆角矩形、自定义多路径图形
查看>>
delphi FMX 数字下拉滑动
查看>>
重磅榜单!互联网金融Top100总估值超1.1万亿,27家独角兽上榜!
查看>>
cocos2d-x wp8 中文显示问题
查看>>
数字证书学习笔记
查看>>
Linux 文件与目录管理
查看>>
sublime3 docblocker插件定制自己的注释,配置步骤
查看>>
【Java并发编程】15、ReentrantLock实现原理深入探究
查看>>
什么是API网关?
查看>>
Linux上查看造成IO高负载的进程
查看>>
Ubuntu18.04 修改DNS
查看>>
Bjarne Stroustrup's C++ Style and Technique FAQ
查看>>
Rhel5.5配置Centos yum源
查看>>
Android 按键式事件
查看>>
关于@property()的那些属性及ARC简介
查看>>
【C++ Primer】【习题】【1.4】
查看>>
潜移默化学会WPF(技巧篇)--TextBox相关(一)
查看>>