输入service mysql status报错
[root@template-centos7 bin]# service mysql status
Redirecting to /bin/systemctl status mysql.service
Unit mysql.service could not be found.
查看环境中有没有mysql,看到在usr目录下又mysql
[root@template-centos7 bin]# whereis mysql
mysql: /usr/lib64/mysql /usr/share/mysql
[root@template-centos7 bin]# chkconfig --list | grep off
或者通过yum list | grep mysql命令来查找yum源中是否有MySQL,看到我的环境中是有的
可以看出,总之看不到mysql-server的影子,那么判断环境中没有安装 mysql-server 服务
先下载mysql的repo源
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
[root@template-centos7 ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
--2021-05-25 11:20:43-- http://repo.mysql.com/mysql-community-release-el7-5.noar