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've been trying to start mysqld under a different user as well as with a different data path. I've done so by modifing the my.cnf file as follows:

[mysqld]
datadir=/bob/database
socket=/bob/database/mysql.sock
user=bob
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/bob/mysqld.log
pid-file=/bob/mysqld.pid

Whenever I try to start the mysql daemon by running service mysqld start two things happen

  1. I get the following error

    ERROR: 1005  Can't create table 'db' (errno: 13)
    121010 13:39:46 [ERROR] Aborting
    121010 13:39:46 [Note] /usr/libexec/mysqld: Shutdown complete
    
  2. The folder /bob/ and everything in it has mysql:mysql permissions which makes me think the user option in my.cnf did not work and because I run the service start command as root it can just chown the dir as mysql:mysql without running into any problems. At the same time when I run that command I get the following warning:

    121010 13:39:46 [Warning] Ignoring user change to 'mysql' because the user was set to 'bob' earlier on the command line
    

Any help would be greatly appreciated.

***UPDATE

If instead of having the bob user, I put the mysql user and change the permissions of the bob folder to mysql everything works fine. So this is a problem with changing the user not a different data path.

share|improve this question
    
Make sure the /bob/ folder has the permissions to read and write –  The Unwanted Oct 10 '12 at 18:07
    
@Stranger it does. Permissions are 777 for testing purposes. –  Flo Oct 10 '12 at 18:10
add comment

migrated from stackoverflow.com Oct 11 '12 at 10:29

This question came from our site for professional and enthusiast programmers.

1 Answer

i think changing the user in the mysql-config has only effect when the mysqld is started during the boot process - see here

share|improve this answer
    
I think what they were trying to say was that if you wanted mysqld to automatically run as that user on startup you would have to change the mysql-config file. Regardless if I restart it, mysql doesn't care if its during boot process or not, it will follow the same steps. –  Flo Oct 10 '12 at 18:20
add comment

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.