case:

sudo service mysql start
Copy the code

Tips to follow:

Starting MySQL database server mysqld No directory, logging in with HOME=/ mkdir: cannot create directory '//. Cache' : Permission denied -su: 19: /etc/profile.d/wsl-integration.sh: cannot create //.cache/wslu/integration: Directory nonexistentCopy the code

Prompt no permission, file directory does not exist, the specific reason has not gone to look closely, the following is to solve the paste

1.cat /etc/passwd | grep mysql

mysql:x:111:115:MySQL Server,,,:/nonexistent:/bin/false
Copy the code

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

3.cat /etc/passwd | grep mysql

root:x:1000:1000:,,,:/var/lib/mysql:/bin/bash
Copy the code

4.sudo service mysql start

OK
Copy the code

Ps: If you encounter a mysql user in precess,

usermod: user mysql is currently used by process 82
Copy the code

Use the ps – ef | grep mysql to find mysql related service process have to do is to kill off