mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' 解决方法
来源:互联网 发布:排序算法有几种 编辑:程序博客网 时间:2024/05/19 21:16
今天在mbp下用zoc连接到一个linux云主机上,进行操作,因为安全问题 mysql没有开发远程连接,只能在上面用命令行。
可是用mysql -uroot -p命令死活连接不上,提示下面错误:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
搜了很多资料,讲得千奇百怪,反正是各种方法试过了,也没解决问题。
后面想啊,自己是远程连接到那台云主机上的,是不是连接mysql的时候得把本地ip加上才行,
于是把命令改成:
mysql -uroot -h127.0.0.1 -p
试了下,成功了。
0 0
- Mysql error 2002 (HY000) : Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- mysql 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'
- 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)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
- 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)
- 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 '/tmp/mysql.sock' (2)
- 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)
- 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'
- 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 '/tmp/mysql.sock' (2)
- 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 '/tmp/mysql.sock' (111)
- OSG在WIN与VS中配置与测试
- 自适应UITextView和键盘位置
- c++11 std - nullptr
- linux下安装,卸载,以及查看安装的软件
- android 设置录制视频的时长与大小限制,超时、超大小时自动停止
- mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' 解决方法
- Windows 系统盘已使用空间超过实际大小的原因与解决方法
- 屌丝程序员的故事-加薪后的苦恼
- MFC SendMessage()函数传递字符串
- Activity的Launch mode详解 singleTask正解
- Python学习笔记(2)格式化字符串
- SQL Server 游标使用
- volatile关键字
- OpenCV中的内存泄露问题(cvLoadImage,cvCloneImage)