Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have tried installing mysql several times but keep getting this error:

mysqld: unrecognized service

I've tried:

yum remove mysql-server 
yum remove mysql
yum remove MySQL-*


yum install mysql-server 
yum install mysql 
yum install mysql-devel

and then both

/etc/init.d/mysqld start
service mysqld start

but keep getting that error. Is there a way to recreate that file possibly?

share|improve this question
have you checked my solution? – Rahul Patil Dec 18 '12 at 13:55
Running /etc/init.d/mysqld start returns "mysqld: unrecognized service"? Are you sure? – jsbillings Dec 18 '12 at 15:50
up vote 0 down vote accepted

try :

yum install mysql 
yum install mysql-server 
yum install mysql-devel 
chgrp -R mysql /var/lib/mysql 
chmod -R 770 /var/lib/mysql 
service mysqld start 

It states in the ouptut of the last command to copy and paste mysql.server into the appropriate runlevel area for your install.

find the file mysql.server on the machine anywhere. Anyone know where it is or how to proceed?

It also states to set the passwords for your root account like so

/usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h hostname password 'new-password'

share|improve this answer

you can download mysqld init script from other server or you can use below trick,

since yum unable to remove mysql-server because "/etc/init.d/mysqld" not exists, yum first try to stop using init script then it will remove package, so we just need to place any init script in that location for temporary as below:

 cp /etc/init.d/crond /etc/init.d/mysqld 

then erase mysql-server package

yum erase mysql-server

next , install it again

yum install mysql-server

then check /etc/init.d/mysqld start

share|improve this answer

Try running the mysql service manually and watch the output for what is going wrong. /usr/bin/mysqld_safe

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.