Failed to issue method call: Unitmysql.service failed to load: No such file or directory.

来源:互联网 发布:java注解是什么 编辑:程序博客网 时间:2024/04/30 23:34

腾讯云的服务器重启之后访问不到/var/www/html目录下的项目,我想有可能是httpd的问题(Linux安装的lamp,默认的文档目录是/var/www/html)。

执行service httpd restart 命令之后,得以解决这个问题。但是又发现一个问题,那就是数据库访问不到,用命令service mysqld start去重新启动却报如下的错误信息:

[root@VM_203_146_centos bin]# service mysql start

Redirecting to /bin/systemctl start  mysql.service

Failed to issue method call: Unitmysql.service failed to load: No such file or directory.

解决方法:

执行以下两条命令

1、yum install mariadb-server
systemctl start mariadb

然后就可以正常使用啦


2、如果接下来数据库出现2003错误的话,有可能是数据库的启动方式不对


用命令ps -ef|grep mysql 来显示包含mysql字符的系统执行过程。查看是mysql的启动方式

如果是socket的话,需要改成port方式形式。

解决方法:

需要进入到/etc/my.cnf文件中



0 0