欢迎来到资源库(www.zyku.net)

MySQL

当前位置:首页 > 数据库 > MySQL > 系统报错

Failed to issue method call: Unit mysql.service failed to load: No such file or directory的解决办法

时间:2018-09-04|栏目:MySQL|点击:|我要投稿

1、软件环境:

OpenSUSE 13.1 x64
MySQL 5.6.20 x64

2、采用RPM包安装MySQL 5.6.20

# rpm -ivh MySQL-server-5.6.20-1.sles11.x86_64.rpm
# rpm -ivh MySQL-client-5.6.20-1.sles11.x86_64.rpm
# rpm -ivh MySQL-devel-5.6.20-1.sles11.x86_64.rpm
# rpm -ivh MySQL-shared-5.6.20-1.sles11.x86_64.rpm

3、查看MySQL服务

# /etc/init.d/mysql status
MySQL is not running                                                                                                    failed
mysql.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
Aug 22 15:42:26 173-168-58-139 systemd[1]: Stopped LSB: Start the MySQL database server.

可见,MySQL服务未启动。

4、启动MySQL服务

# /etc/init.d/mysql start
redirecting to systemctl start mysql
Failed to issue method call: Unit mysql.service failed to load: No such file or directory.

报错,无法启动MySQL服务。

用systemctl方法

# systemctl start mysql.service

仍然报如下错误

Failed to issue method call: Unit mysql.service failed to load: No such file or directory. See system logs and 'systemctl status mysql.service' for details.

5、解决方法

# systemctl enable mysql.service

6、再次启动MySQL

# systemctl start mysql
# ps -ef | grep mysql
root     27930     1  0 16:30 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/173-168-58-139.pid
mysql    28045 27930  0 16:30 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/173-168-58-139.err --pid-file=/var/lib/mysql/173-168-58-139.pid
root     28074 25545  0 16:30 pts/1    00:00:00 grep --color=auto mysql

可见,MySQL已经正常运行。

原文链接:https://blog.csdn.net/chszs

(资源库 www.zyku.net)

关于我们 | 版权申明 | 寻求合作 |

重要申明:本站所有的文章、图片、评论等内容,均由网友发表或上传并维护或收集自网络,仅供个人学习交流使用,版权归原作者所有。

如有侵犯您的版权,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:95148658 | 邮箱:mb8#qq.com(#换成@)

苏ICP备2020066115号-1

本网站由提供CDN加速/云存储服务