安装。由于 wsl 中 root 用户不会创建密码,所以需要手动创建:
sudo apt install -y mysql-server
sudo mysql -uroot
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
完全卸载:
sudo apt remove --purge *mysql*
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get remove --purge *mariadb*
sudo apt-get autoremove
sudo apt-get autoclean