To install MySQL on WSL (ie. Ubuntu):
Open your WSL terminal (ie. Ubuntu).
Update your Ubuntu packages: sudo apt update
Once the packages have updated, install MySQL with: sudo apt install mysql-server
Confirm installation and get the version number: mysql --version
Start a MySQL server: sudo service mysql restart
Start the security script prompts: sudo mysql_secure_installation
To open the MySQL prompt, enter: sudo mysql
SHOW DATABASES;
CREATE DATABASE database_name;
DROP DATABASE database_name;
标签:sudo,install,Ubuntu,WSL,Install,mysql,MySQL,wsl2
From: https://www.cnblogs.com/wl30564/p/16888534.html