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已经正常运行。