(我在 Windows 10 上有 MySQL 服务器,但在端口 3307 上。如果这很重要,但以防万一!)
我不能sudo service mysql start也不能sudo /etc/init.d/mysql start,它又回来了
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 nonexistent [Failed]
Run Code Online (Sandbox Code Playgroud)
我搜索了有关在 Ubuntu 中重新安装 mysql 的信息,并按照以下步骤操作。
- https://github.com/microsoft/WSL/issues/1761
sudo su
apt-get remove --purge 'mysql*'
apt-get autoremove
apt-get autoclean
rm -f /etc/mysql /var/lib/mysql
apt-get install mysql-server
Run Code Online (Sandbox Code Playgroud)
但是在尝试时apt-get install mysql-server我得到了下面的错误。
invoke-rc.d: could not determine …Run Code Online (Sandbox Code Playgroud)