Can 't connect to local MySQL server through socket '/tmp/mysql.sock ' "
Posted cnblogs_2015
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Can 't connect to local MySQL server through socket '/tmp/mysql.sock ' "相关的知识,希望对你有一定的参考价值。
安装了mysql, 使用命令mysql -u root -p 弹出Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) "。
创建软链接即可。
[[email protected] tmp]# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
[[email protected] tmp]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 3
Server version: 5.6.41 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
以上是关于Can 't connect to local MySQL server through socket '/tmp/mysql.sock ' "的主要内容,如果未能解决你的问题,请参考以下文章
MySQL Can't connect to MySQL server on 'localhost' (10061)
Jenkins: Can't connect to Docker daemon解决办法
MySQL错误2003:Can't connect to MySQL server (10060)
Can't connect to MySQL server on 'localhost'(10061)解决方法