错误2002(HY000):无法通过套接字'/tmp/mysql.sock'连接到本地MySQL服务器 [英] ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

查看:290
本文介绍了错误2002(HY000):无法通过套接字'/tmp/mysql.sock'连接到本地MySQL服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac OS X Mountain Lion上使用homebrew install mysql安装了MySQL,但是当我尝试mysql -u root时出现以下错误:

I installed MySQL on Mac OS X Mountain Lion with homebrew install mysql, but when I tried mysql -u root I got the following error:

ERROR 2002(HY000):无法通过套接字'/tmp/mysql.sock'(2)连接到本地MySQL服务器

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

此错误是什么意思?我该如何解决?

What does this error mean? How can I fix it?

推荐答案

可能是因为MySQL已安装但尚未运行.

It's probably because MySQL is installed but not yet running.

要验证其是否正在运行,请打开活动监视器",然后在所有进程"下搜索并验证您是否看到了进程"mysqld".

To verify that it's running, open up Activity Monitor and under "All Processes", search and verify you see the process "mysqld".

您可以通过安装"MySQL.prefPane"来启动它.

You can start it by installing "MySQL.prefPane".

以下是对我有帮助的完整教程: http://obscuredclarity.blogspot.in/2009/08/install- mysql-on-mac-os-x.html

Here is the complete tutorial which helped me: http://obscuredclarity.blogspot.in/2009/08/install-mysql-on-mac-os-x.html

这篇关于错误2002(HY000):无法通过套接字'/tmp/mysql.sock'连接到本地MySQL服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆