分享

Unit mysqld.service could not be found.

 融水公子 2024-04-26 发布于安徽
表白:黑白圣堂血天使,天剑鬼刀阿修罗。 
讲解对象:
/Unit mysqld.service could not be found.
作者:融水公子 rsgz
===

Unit mysqld.service could not be found.

centos7里面执行

systemctl status mysqld.service
然后就出现了Unit mysqld.service could not be found.报错!

这是主流的处理方法:
1 这个命令本质调用的是:/bin/systemctl status mysqld.service  但是依旧找不到mysqld.service
[root@rsgz ~]# service mysqld status
Redirecting to /bin/systemctl status mysqld.service
Unit mysqld.service could not be found

2 查询/etc/init.d/下是否存在mysql
ll /etc/init.d/ | grep mysql

3 查询mysql.server
find / -name mysql.server

4 把mysql.server复制到/etc/init.d/mysql中,假如你的安装在/usr/local/mysql/
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql

当然我碰到另一种情况。

查看一下进程,有数字就有进程:

[root@rsgz ~]# pidof mysqld
1278
[root@rsgz ~]# ps aux | grep mysqld

安装了mysql很久了,我忘了我当时安装的是MariaDB数据库(这个和mysql一模一样,就是名字不同),所以查看数据库状态的命令要改成这样:
启动:systemctl start mariadb.service
停止:systemctl stop mariadb.service
状态:systemctl status mariadb.service

接下来使用这个命令就能查看到状态了


===
 
公众号:不浪仙人
谢谢大家的支持!可以点击我的头像,进入我的空间浏览更多文章呢。建议大家360doc[www.360doc.com]注册一个账号登录,里面真的有很多优秀的文章,欢迎大家的到来。
---
';

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多