How to use mysql in wsl without installing any separate MySQL client for Windows.
How to use mysql in wsl without installing any separate MySQL client for Windows.
Inside your bash command line:
sudo apt-get update
sudo apt-get install mysql-server
mysql_secure_installation
Here is how I have accessed MySQL installed in Windows 10 through WSL:
1. Create a user with remote access
CREATE USER 'newuser'@'%' IDENTIFIED BY 'pass';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'%';
FLUSH PRIVILEGES;
2. Update mysql.ini
bind-address=0.0.0.0
# skip-external-locking
3. Test connection using local IP
>mysql -h192.xxx.xx.xx -P 3306 -unewuser -p