首页 > 解决方案 > 在 CentOS 8 上安装 mysql-server 时出错

问题描述

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

有人可以解释为什么我收到此错误以及如何在安装时解决它mysql-servermysql_secure_installation

同样,安装时出现错误maridb-server

[root@servera-clone ~]# 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)
Enter current password for root (enter for none): 

谢谢

标签: mysqlmariadbcentos8

解决方案


推荐阅读