【问题标题】:How to use MySQL in WSL (Windows Subsystem for Linux)?如何在 WSL(Linux 的 Windows 子系统)中使用 MySQL?
【发布时间】:2017-11-28 05:28:57
【问题描述】:

如何在 wsl 中使用 mysql 而无需为 Windows 安装任何单独的 MySQL 客户端。

【问题讨论】:

标签: mysql windows-subsystem-for-linux


【解决方案1】:

在你的 bash 命令行中:

sudo apt-get update
sudo apt-get install mysql-server
mysql_secure_installation

【讨论】:

    【解决方案2】:

    这是我通过 WSL 访问安装在 Windows 10 中的 MySQL 的方式:

    1.创建具有远程访问权限的用户

    CREATE USER 'newuser'@'%' IDENTIFIED BY 'pass';
    GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'%';
    FLUSH PRIVILEGES;
    

    2。更新 mysql.ini

    bind-address=0.0.0.0
    # skip-external-locking
    

    3.使用本地 IP 测试连接

    >mysql -h192.xxx.xx.xx -P 3306 -unewuser -p
    
    猜你喜欢
    • 2017-03-20
    • 2022-06-13
    • 2019-01-02
    • 2021-05-05
    • 1970-01-01
    • 2020-09-24
    • 2018-07-09
    • 2019-07-03
    • 1970-01-01
    相关资源
    最近更新 更多