Skip to content

Instantly share code, notes, and snippets.

@khoimm92
Forked from e-cloud/README.md
Created April 17, 2021 04:26
Show Gist options
  • Save khoimm92/8aa65627289a6fff3a8886511137791d to your computer and use it in GitHub Desktop.
Save khoimm92/8aa65627289a6fff3a8886511137791d to your computer and use it in GitHub Desktop.
Install mysql 8.0 on wsl
wget -c "https://gist.github.com/e-cloud/34acbefe0597a02f9a081a01eff6dd24/raw/3bad7148f60ab70659b0be14ef07b0bd4d019f62/install-mysql8-on-wsl.sh" install-mysql8-on-wsl.sh
chmod 740 install-mysql8-on-wsl.sh
./install-mysql8-on-wsl.sh
#!/usr/bin/env bash
mysql_apt_deb=mysql-apt-config_0.8.14-1_all.deb
sudo apt-get remove mysql-server mysql-client -y
sudo apt-get autoremove -y && sudo apt-get autoclean -y
wget –c "https://dev.mysql.com/get/${mysql_apt_deb}"
sudo dpkg -i $mysql_apt_deb # select 5.7
sudo apt-get update
sudo apt policy mysql-server #(it will show 5.x is the default candidate)
sudo apt-get -y install mysql-server
# ensure your host windows have no mysql service running
sudo service mysql start
sudo service mysql stop
sudo dpkg -i $mysql_apt_deb # select 8.0
sudo apt-get update
sudo apt policy mysql-server #(it will show 8.x is the default candidate)
sudo apt-get -y install mysql-server
sudo sed -ie 's/\/usr\/share\/mysql\/mysql-helpers/\/usr\/share\/mysql-8.0\/mysql-helpers/' /etc/init.d/mysql
sudo service mysql start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment