Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using MySQL on CentOS and I want it to run at startup under the mysql user. I tried /sbin/chkconfig --level 35 mysqld on from my cool-RR user, but it seems like this makes mysql try to run as cool-RR. How do I make it run on startup as user mysql?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

It should start as mysql user by default. You are probably starting the daemon under your own user account, you should use the startup script instead, which will execute using the config files in /etc

i.e.

service mysqld stop
service mysqld start
share|improve this answer

In /etc/mysql/my.cnf, set "user" to "mysql" in the [mysqld] section.

share|improve this answer
    
There was no /etc/mysql/my.cnf, only /etc/my.cnf, and the thing you said was already set to "mysql", but it's not working! –  Ram Rachum Sep 17 '09 at 0:48

Execute the following commands from under your account:

su
chkconfig mysqld on

Then you can restart service by service mysqld restart. You can check which user it is running under by issuing

ps aux | grep mysqld
share|improve this answer

Your Answer

 
discard

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.