windows子系统安装mysql服务器

Ант*_*рак 17 mysql windows-10 windows-subsystem-for-linux

在 ubuntu 18.04 子系统 Windows 10 上安装 mysql-server。

Cannot open /proc/net/unix: No such file or directory
Cannot stat file /proc/1/fd/5: Operation not permitted
Cannot stat file /proc/3/fd/7: Operation not permitted
Run Code Online (Sandbox Code Playgroud)

请帮忙

在此处输入图片说明

Noh*_*lah 7

我在 Windows 10 下使用 Ubuntu 18.04 作为子系统,因此您必须首先通过以下方式添加 MariaDB 所需的存储库:

sudo apt-get install software-properties-common

然后通过以下方式更新您的安装:

sudo apt 更新

通过以下方式安装 MariaDB:

sudo apt 安装 mariadb 服务器

系统将提示您设置 root 密码并等待安装继续。安装完成后发出以下命令:

须藤服务 mysql 启动

就是这样,要检查您的 mysql 和 mariadb 版本,请尝试:

mysql --version


小智 5

正如 github 上的一个人所提到的,它解决了我的问题 问题出在脚本“/etc/profile.d/wsl-integration.sh”上。作为快速解决方法,在“/etc/profile.d/wsl-integration.sh”中的第一行之前插入以下行(使用 sudo 编辑文件):

# Check if we have HOME folder
if [ "${HOME}" = "/" ]; then
  return
fi
Run Code Online (Sandbox Code Playgroud)

我的意思是在该行之前:

WSL_INTEGRATION_CACHE=$HOME/.cache/wslu/integration`
Run Code Online (Sandbox Code Playgroud)

  • 我的系统上没有该文件 (3认同)
  • 呵呵,当他们提到我时,读“一个家伙”很奇怪。在同一链接中有对此问题的改进答案。我也会在这里编辑 (2认同)

小智 4

对于遇到此问题的任何人,请关闭并重新打开 WSL,然后运行 ​​sudo service mysql start sudo dpkg --configure -a 它应该完成。