Lab 0 - Install MySQL in your Codespaces Environment
Instructions
We get to practice with a few more unix commands!
-
First, we'll download the MySQL repository package with these commands:
sudo apt install wget -y wget https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb
-
Next, we'll install the MySQL package with this command:
sudo apt install ./mysql-apt-config_*_all.deb
-
When prompted, use the arrow keys to move to MySQL Server & Cluster and then select Ok or press the Enter key. Next, choose mysql-8.0. Then choose Ok or press the Enter key. You'll end up back at the configure screen. Select Ok and press the Enter key.
-
Then we'll rebuild the cache:
sudo apt update
-
Now we'll install MySQL Server.
sudo apt install mysql-server
-
When prompted, choose
Y
. -
Set the password for root. I recommend using
student
so that your codespace is consistent with the demos. -
Choose Use Legacy Auth.
-
To start the server run:
sudo mysqld_safe
sudo mysqld_safe
You will need run
sudo mysqld_safe
this each time you start up Codespaces and want to use MySQL.
Resource: https://bobcares.com/blog/install-mysql-debian-bullseye/