(MySQL 8, WSL 2) su: warning: cannot change directory to /nonexistent: No such file or directory
See original GitHub issueHi Miguel, I just recently switched and moved my project files from WSL 1 to the WSL 2 environment.
Specs:
-
Ubuntu 20.04 LTS
-
Python 3.8.2
.
But I’m having problems starting MySQL in (venv) environment please see the below warning message. Is this an issue that you have seen in the past? When starting MySQL outside of (venv) it runs ok.
When I check if MySQL is installed in both inside and outside of (venv) environment the terminal says that they are installed in both.
(venv)$ sudo service mysql start
* Starting MySQL database server mysqld
su: warning: cannot change directory to /nonexistent: No such file or directory
sleep: cannot read realtime clock: Invalid argument
$ sudo service mysql start
* Starting MySQL database server mysqld
$ mysql --version
mysql Ver 8.0.21-0ubuntu0.20.04.4 for Linux on x86_64 ((Ubuntu))
(venv)$ mysql --version
mysql Ver 8.0.21-0ubuntu0.20.04.4 for Linux on x86_64 ((Ubuntu))
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
error: su: warning: cannot change directory to /nonexistent
mysql user is looking for a home directory, which seems to have not been assigned. To do that, you can execute:
Read more >How to install MySQL on WSL 2 (Ubuntu) - Pen-y-Fan
How to install and configure MySQL 8.0 on WSL 2 (Ubuntu), ... su: warning: cannot change directory to /nonexistent: No such file or ......
Read more >how to start mysql server on Ubuntu 20.04
I have Ubuntu installed via WSL 2 like so: Ubuntu 20.04.4 LTS ... su: warning: cannot change directory to /nonexistent: No such file...
Read more >mysql 启动失败:su: warning: cannot change directory to ...
mysql 启动失败:su: warning: cannot change directory to /nonexistent: No such file or directory - 汪成龙的博客- 博客园
Read more >error":"NonExistentPath: Data directory /data/db not found. C Code ...
mysql cannot change directory to /nonexistent ... mkdir: `hdfs://127.0.0.1:9000/user/hadoop': No such file or directory · tried accessing the FileTransfer ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve just confirmed that this is still an issue on a fresh install. Someone has found a workaround for this issue:
This creates a home directory for the mysql user. The mysql user typically doesn’t have a home directory on purpose (I presume that this is because this prevents someone from logging in as that user). This shouldn’t be much of an issue for WSL installations unless you’re crazy enough to use WSL for a public facing server. In that case, your best bet is just starting the service twice.
Source: https://serverfault.com/questions/755763/mysql-nonexistent-home-vs-no-directory-logging-in-with-home/942422
I have not seen this error myself, but Google is your friend: https://stackoverflow.com/questions/62987154/mysql-wont-start-error-su-warning-cannot-change-directory-to-nonexistent.