MySQL won’t start – error: su: warning: cannot change directory to /nonexistent: No such file or directory

mysql user is looking for a home directory, which seems to have not been assigned.
To do that, you can execute:

sudo systemctl stop mysql.service
sudo usermod -d /var/lib/mysql/ mysql
sudo systemctl start mysql.service

or

sudo service mysql stop
sudo usermod -d /var/lib/mysql/ mysql
sudo service mysql start

Based on a response found here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)