Server Fault is a question and answer site for system and network administrators. 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

Ok, so I'm not sure what changed as I am by no means an expert in the ways of mysql or linux (I know most of the basics) but when I restart mysql via "service mysqld restart" it doesn't actually restart mysql at all. Nor will it stop.

So I ran "ps aux | grep mysqld" and noticed its being run by root as well as mysql user?! Im not really sure how this can happen?

root     31191  0.0  0.0  65948  1356 ?        S    Mar12   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/ --basedir=/usr --user=mysql

mysql    31896  1.4 23.2 3983432 3823924 ?     SLl  Mar12  56:49 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/db.local.err --open-files-limit=8192 --pid-file=/var/run/mysqld/ --socket=/var/lib/mysql/mysql.sock --port=3306

Would anyone be able to give some insight on how this could happen? I did some googling and I dont know if I am using wrong search terms but I'm not finding anything helpful.

share|improve this question
up vote 2 down vote accepted

Nothing is wrong with your system.In fact, using mysqld_safe is the recommended way of starting mysql in Unix. Check official documentation here.

mysqld_safe is the recommended way to start a mysqld server on Unix. mysqld_safe adds some safety features such as restarting the server when an error occurs and logging runtime information to an error log file.

You can tell from the process id that mysqld_safe initiated mysqld, having it run under the user mysql, --user=mysql. And all the other run time parameters are specified when starting mysqld_safe, to be used by the mysql daemon.

share|improve this answer
Oh, ok. Thats cool but how would I restart the service then? – Tyler Mar 15 '13 at 14:09
use mysqladmin. If your mysql root access requires a password, for instance, use mysqladmin -uroot -p shutdown. Then start it using the mysqld_safe command you used to begin with. – Daniel t. Mar 15 '13 at 14:17
Awesome! Thank you so much. – Tyler Mar 15 '13 at 14:32

mysqld_save is just a script which in turn calls mysqld and does some additional neat stuff. So everything looks fine with your system.

share|improve this answer
I appreciate the info. Thanks! – Tyler Mar 15 '13 at 14:34

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.