当前位置: 移动技术网 > IT编程>数据库>Mysql > linux安装MySQL后输入mysql显示 ERROR 2002 (HY000): Can't connect to local MySQL server through socket

linux安装MySQL后输入mysql显示 ERROR 2002 (HY000): Can't connect to local MySQL server through socket

2019年06月09日  | 移动技术网IT编程  | 我要评论

我是小白,大佬勿喷
***

linux安装mysql后输入mysql显示

error 2002 (hy000): can't connect to local mysql server through socket
解决办法
输入service mysql restart

root@des:/# service mysql restart
 * stopping mysql database server mysqld                                                                         [ ok ]
 * starting mysql database server mysqld                                                                                no directory, logging in with home=/
                                                                                                                 [ ok ]

然后输入mysql

root@des:/# mysql
welcome to the mysql monitor.  commands end with ; or \g.
your mysql connection id is 4
server version: 5.7.26-0ubuntu0.18.04.1 (ubuntu)

copyright (c) 2000, 2019, 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.

type 'help;' or '\h' for help. type '\c' to clear the current input statement.

mysql>

问题解决

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网