码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2018-10-28 16:10:22      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:linux   com   ror   bin   ln -s   sock   nan   nbsp   oct   

 

[root@pisphkdcbsql01 mysql3307]# /opt/mysql3307/bin/mysql -upisp -ppisp@123
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Cant connect to local MySQL server through socket /tmp/mysql.sock (2)

 

解决办法

[root@pisphkdcbsql01 tmp]# ln -s /opt/mysql3307new/mysql-3307.sock mysql.sock
[root@pisphkdcbsql01 tmp]# ll -thr
total 4.9M
-rw------- 1 root  root   783 May 26  2017 yum_save_tx-2017-05-26-09-23etoC8C.yumtx
-rw-r--r-- 1 root  root    42 Jan  8  2018 network.bak
-rw------- 1 root  root   248 Jan  9  2018 yum_save_tx-2018-01-09-11-33Y0mCc_.yumtx
-rw------- 1 root  root  1.7K Jan  9  2018 yum_save_tx-2018-01-09-11-48cbmJd8.yumtx
-rw------- 1 root  root   513 Jan  9  2018 yum_save_tx-2018-01-09-12-047IB4sD.yumtx
-rw-r--r-- 1 root  root   521 Jan  9  2018 centos6_haikou_nanshu.repo
-rw-r--r-- 1 root  root  4.5M Jan 30  2018 zabbixagent_for_linux.tar.gz
-rw-r--r-- 1 root  root  2.5K Jan 30  2018 zabbix_install.bash
-rw-rw-rw- 1 mysql mysql  708 Mar 16  2018 sql.csv
-rw-r--r-- 1 root  root    32 Oct 25 10:39 lock.txt
drwxr-xr-x 2 root  root  4.0K Oct 25 12:31 yum-bak
-rw-r--r-- 1 root  root     0 Oct 27 09:19 mysql-3307.pid.shutdown
-rw------- 1 mysql mysql    5 Oct 27 09:27 mysql-3307.sock.lock
-rw-r--r-- 1 root  root  299K Oct 28 14:20 connect.log
lrwxrwxrwx 1 root  root    33 Oct 28 14:20 mysql.sock -> /opt/mysql3307new/mysql-3307.soc

 

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

标签:linux   com   ror   bin   ln -s   sock   nan   nbsp   oct   

原文地址:https://www.cnblogs.com/paul8339/p/9865518.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!