【发布时间】:2012-09-19 06:08:40
【问题描述】:
当我尝试使用
登录 mysql shell 时mysql -u root -p
我收到了
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
请帮我看看mysql有什么问题
我可以使用mysql --host=127.0.0.1 frontend登录
更新 /etc/hosts
127.0.0.1 localhost
127.0.1.1 shweta-desktop
127.0.0.1 webfaction
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
【问题讨论】:
-
请将您的 /etc/hosts 文件添加到问题中
-
netstat -ln | grep mysql 会告诉你套接字路径在哪里
标签: mysql