Linux安装mysql遇到Unit mysql.service could not be found.

问题描述

Linux安装mysql遇到Unit mysql.service could not be found._第1张图片
具体原因未知
之后去网上找大佬博客
解决Unit mysql.service could not be found

然而我没成功,你们可以试试,哈哈哈
Linux安装mysql遇到Unit mysql.service could not be found._第2张图片

删库(只建议刚安装的)

我就准备重新安装mysql,体验一下删除数据库的感觉,手动狗头

查看MySQL对应的文件夹

[root@lh ~]#  find / -name mysql
/usr/share/mysql
/usr/local/src/mysql
/usr/lib64/mysql
/usr/bin/mysql
/usr/lib/mysql
/etc/logrotate.d/mysql
/etc/selinux/targeted/active/modules/100/mysql
/var/lib/mysql
/var/lib/mysql/mysql

Linux安装mysql遇到Unit mysql.service could not be found._第3张图片
删除这些文件

[root@lh ~]# rm -rf /var/lib/mysql
[root@lh ~]# rm -rf /var/lib/mysql/mysql
[root@lh ~]# rm -rf /usr/lib64/mysql

卸载并删除MySQL安装的组键服务

[root@lh ~]# rpm -qa | grep -i mysql
mysql-community-common-5.6.49-2.el7.x86_64
mysql-community-libs-5.6.49-2.el7.i686
mysql-community-server-5.6.49-2.el7.x86_64
mysql-community-release-el7-5.noarch
mysql-community-libs-5.6.49-2.el7.x86_64
mysql-community-common-5.6.49-2.el7.i686
mysql-community-client-5.6.49-2.el7.i686
mysql-community-client-5.6.49-2.el7.x86_64

Linux安装mysql遇到Unit mysql.service could not be found._第4张图片

rpm -ev --nodeps mysql-community-common-5.6.49-2.el7.x86_64

执行类似上述这样的命令,需要执行八次,因为 有八个文件,心酸…
这样再看看

rpm -qa | grep -i mysql

就会全部删除了

重新下载

Linux安装mysql遇到Unit mysql.service could not be found._第5张图片

具体安装下载与启动Mysql参考我的博客

买了阿里云服务器和域名,如何搭建Web项目

你可能感兴趣的:(java报错问题解决,数据库,mysql,linux,centos,java)