windows subsystem install mysql server

前端 未结 6 1496
心在旅途
心在旅途 2021-02-19 10:30

installing mysql-server on ubuntu 18.04 subsystem windows 10.

Cannot open /proc/net/unix: No such file or directory
Cannot stat file /proc/1/fd/5: Operation not          


        
相关标签:
6条回答
  • 2021-02-19 10:43

    I can't install mysql on wsl either (mysql 5.7.30, ubuntu 18.04, win10 1909), so there is workaround here. Install and run mysql on windows, then connect it from ubuntu bash by using:

    mysql -u root -p --host=127.0.0.1 --port=3306 --protocol=TCP
    

    Also need to config Database in your porject settings. Don't use localhost, and port is 3306 on my pc, might be different from yours. Hope they can fix it on wsl2.

    0 讨论(0)
  • 2021-02-19 10:47

    I meet save issue. The reason is you have a MySQL-server installed on your native OS Win10. How to fix it:

    1. Go to Windows service, stop the MySQL service.

    2. Modify my.ini under MySQL server folder, mine is C:\Program Files\MySQL\MySQL Server 5.5

      [mysqld]
      \# The TCP/IP Port the MySQL Server will listen on
      port=3306 -> 3308 or other
      
    3. Restart your wsl instance.

    4. Reinstall the MySQL-server with root account

      apt install mysql-server
      service mysql start
      mysql_secure_installation
      
    0 讨论(0)
  • 2021-02-19 10:53

    as mentioned a guy at github and it solved my problem The problem is with the script "/etc/profile.d/wsl-integration.sh". As a quick workaround insert the following line before the first line in "/etc/profile.d/wsl-integration.sh" (use sudo to edit the file):

    # Check if we have HOME folder
    if [ "${HOME}" = "/" ]; then
      return
    fi
    

    I mean before the line:

    WSL_INTEGRATION_CACHE=$HOME/.cache/wslu/integration`
    
    0 讨论(0)
  • 2021-02-19 10:56

    I am using Ubuntu 18.04 under Windows 10 as a Subsystem, so You have to start off by adding repositories required by MariaDB by :

    sudo apt-get install software-properties-common

    Then update your installation by :

    sudo apt update

    Install MariaDB by :

    sudo apt install mariadb-server

    You’ll be prompted to set a root password and wait for the installation to continue. Issue the following command once installation is complete:

    sudo service mysql start

    That’s it and to check both your mysql and mariadb version try:

    mysql --version

    0 讨论(0)
  • 2021-02-19 10:56

    For anyone running into this issue, Close and reopen WSL and then run sudo service mysql start sudo dpkg --configure -a it should complete.

    0 讨论(0)
  • 2021-02-19 11:03

    I had a MySQL already running on my native Windows 10 system. It must have been trying to fight for the same defaults. I tried switching native MySQL off and then working with WSL installation and it worked somehow.

    0 讨论(0)
提交回复
热议问题