热线电话:13121318867

登录
2019-03-04 阅读量: 957
centos7安装MySQL后启动报错2002?

centos7安装MySQL后启动报错2002?

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

答:这是由于权限问题导致的,/var/lib/mysql的所有者与所属组都是mysql

下面的命令把/var/lib/mysql的拥有者改为当前用户:

$ sudo chown -R openscanner:openscanner /var/lib/mysql

然后,重启服务:

$ service mysqld restart

接下来登录重置密码:

$ mysql -u root
mysql > use mysql;
mysql > update user set password=password(‘123456‘) where user=‘root‘;
mysql > exit;

20.8975
4
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子