使用mariadb遇到的问题汇总

系统版本
Linux version 3.10.0-862.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Fri Apr 20 16:44:24 UTC 2018

登录时:无法连接socket

# mysql -uroot -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

原因:没有启动service
解决方法:启动service

启动服务时:Unit not found.

# systemctl start mariadb.service
Failed to start mariadb.service: Unit not found.

原因:使用yum install mysql 时,没有安装server
解决方法:
yum -y install mariadb-server mariadb mariadb-client mariadb-devel

你可能感兴趣的:(学习笔记,mysql,学习)