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:

# Disabling symbolic-links is recommended to prevent assorted security risks


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.


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.

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

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

  • Make sure the /bob/ folder has the permissions to read and write – gks Oct 10 '12 at 18:07
  • @Stranger it does. Permissions are 777 for testing purposes. – Flo Oct 10 '12 at 18:10
  • if you use centos/redhat it could be a selinux issue.. if you use ubuntu it might be apparmour. – Mike May 10 '15 at 5:30

You may want to check init script, like /etc/init.d/mysqld or something like that, to see if it initialize mysql database with mysql user.

  • Yes: in /etc/init.d/mysql, su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &" should be changed to su - bob -s /bin/bash -c "mysqld_safe > /dev/null &" – Jerome Jaglale Apr 13 '16 at 22:14

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

  • 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

As Jerome explained we have to change one more file

su - mysql -s ... become su - bob -s ...

but with Ubuntu 18.04 we also need to change this one...

user=mysql become user=bob

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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