13

I'm sorry if this question has already been asked, but I can't find any solution to this (maybe small) issue:

I just made a fresh install of mysql-server 5.7 on a 14.04 server. Every time the MySQL service starts, I get this error:

root@xxx:/etc/mysql# service mysql restart
 * Stopping MySQL Community Server 5.7.11
...
 * MySQL Community Server 5.7.11 is stopped
 * Re-starting MySQL Community Server 5.7.11
No directory, logging in with HOME=/
..
 * MySQL Community Server 5.7.11 is started

What does that mean? Do I have to set a home directory to the user "mysql"? (and if so, what is the best choice? /home/mysql??) Now it's to /nonexistent:

mysql:x:110:106:MySQL Server,,,:/nonexistent:/bin/false

but I have another machine with the same /nonexistent, and it doesn't show any error...

26

Having same issue to get rid of this error i did the following

  1. Stop MYSQL service:

    sudo service mysql stop

  2. Change home directory of mysql from nonexistent to original directory where it is supposed to be:

    sudo usermod -d /var/lib/mysql/ mysql

Now start mysql server again with:

sudo service mysql start

The error message has disappeared. Still why this happen is unknown.

  • It might be a work around but I would disagree with this. /home/ is for users. Not for creating a place for dummy users that are needed for security/permissions/whatever. The person suggesting /home/mysql and creating an actual mysql user should be seriously reprimanded. – Rinzwind Feb 23 '16 at 11:15
  • /var/lib o /var/log? Anyway, that directory doesn't seem to be getting populated with any data – the_nuts Feb 23 '16 at 12:40
  • 2
    yea this is a workaround let me know when you find a solution. – Abdul Hayee Feb 24 '16 at 5:51
  • 1
    According to this post, Red Hat has mysql home directory set to /var/lib/mysql. So this seems ok.... – ostrokach Jun 12 '16 at 23:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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