当前位置:Gxlcms > 数据库问题 > MySQL登录报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

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

时间:2021-07-01 10:21:17 帮助过:18人阅读

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   

人气教程排行