admin管理员组

文章数量:1567301

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

数据库成功登录

 

 

本文标签: 错误LocalmysqlconnectServer