M BUZZ CRAZE NEWS
// general

MySQL 5.7 No directory, logging in with HOME=/

By Daniel Rodriguez

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...

2

2 Answers

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.

10

I would furtrher suggest a permanent solution, if it always run from the same dir as I suppose it should why not edit the user mysql in /etc/passwd:

mysql:x:106:111:MySQL Server,,,:/var/lib/mysql/:/bin/false

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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