[Linux]Service mysql start出错(mysql: unrecognized service)解决方法

service mysql start出错,mysql启动不了,解决mysql: unrecognized service错误的方法如下:

[hitony ~]# service mysql start
mysql: unrecognized service
[hitony ~]# service mysql restart
mysql: unrecognized service

[hitony ~]# rpm -q mysql 查询发现mysql已经正常安装
mysql-5.1.52-jason.1

[hitony ~]# /etc/rc.d/init.d/mysqld start 直接启动没问题
Starting mysqld: [ OK ]


[hitony ~]# ls /etc/rc.d/init.d/mysqld -l
-rwxr-xr-x 1 root root 5509 Dec 18 02:31 /etc/rc.d/init.d/mysqld

[hitony ~]# chkconfig mysqld on 设置mysql开机启动

[hitony ~]# chmod 755 /etc/rc.d/init.d/mysqld 修改mysqld执行权限

[hitony ~]# service mysqld start 搞定
Starting mysqld: [ OK ]
[hitony ~]# service mysqld start
Starting mysqld: [ OK ]
[hitony ~]# service mysqld status
mysqld (pid 9487) is running...

 

posted @ 2016-09-12 14:26  再見理想  阅读(7849)  评论(0编辑  收藏  举报