17
03
2008
Can’t change to run as user ‘mysql’. Please check that the user exists!
Posted by Buzz in Linux, mySQLSo you’ve recently made a change to your mysql installation and see the following in
/var/lib/mysql/server.err
1 2 | 080317 14:08:50 mysqld started 080317 14:08:50 [ERROR] Fatal error: Can't change to run as user 'mysql' ; Please check that the user exists! |
1 2 3 4 5 | 080317 14:08:50 [ERROR] Aborting 080317 14:08:50 [Note] /usr/sbin/mysqld: Shutdown complete 080317 14:08:50 mysqld ended |
This is a problem that many a time spent on google has not found the result, so I am writing here what exactly to do in this situation …
First off
1 | cd /var/lib/mysql |
Now run
1 | ls -la |
No doubt you will see something similar to this:
1 | drwx--x--x 2 27 mysql 4096 Mar 17 14:05 mysql |
Notice the “27 mysql”, the user no longer existsing in /etc/passwd.
This is fairly simple to fix.
1 | adduser mysql |
1 | chown mysql:mysql -R /var/lib/mysql |
Now start up Mysql i.e. “service start mysql” and everyhing _should_ be fine.
Entries (RSS)