如何在WSL中使用MySQL而无需安装任何单独的Windows MySQL客户端。
在你的Bash命令行中:
sudo apt-get update
sudo apt-get install mysql-server
mysql_secure_installation
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
>mysql -h192.xxx.xx.xx -P 3306 -unewuser -p