当前位置:   article > 正文

ERROR2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ 错误_enter current password for root (enter for none):

enter current password for root (enter for none): error 2002 (hy000): can't

linux安装mysql后运行mysql_secure_installation时报如下错误

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
经过排查是因为数据库未启动。运行如下命令后,解决此问题,处理完成后再次进行数据库初始化,设置密码

systemctl start mariadb

数据库成功登录

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/786701
推荐阅读
相关标签
  

闽ICP备14008679号