On a Windows box MySQL server can be installed as a regular Windows service or inside WSL, the following will guide you through the WSL installation:
mysql version 8.0.19.
Update and Upagread your WSL
$ sudo apt update && sudo apt upgradeOnce completed restart your bash and install mysql
go super user
$ sudo su
Install mysql server
$ apt-get install mysql-server mysql-client
Check mysql version
$ mysql -V
Start the service
$ service mysql start
Start a session with
$ mysql --host=127.0.0.1 --user=root Change your password to be able to connect to your db in future sprints.
Lets start a session as a super user and once inside our mysql client.
Use the mysql db
>use mysql;
Modify the existing password of root by changing password to your own
>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Finally flush your privilages
>flush privileges;
>exit;Restart the mysql server by
$ service mysql stop
$ service mysql start
now lets try to log into mysql with our new password
$ mysql --host=127.0.0.1 --user=root -pCool now we have mysql set up and ready for action:
