Skip to content

Lab 0 - Install MySQL in your Codespaces Environment

Instructions

We get to practice with a few more unix commands!

  1. 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
    
  2. Next, we'll install the MySQL package with this command:

    sudo apt install ./mysql-apt-config_*_all.deb
    
  3. 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.

  4. Then we'll rebuild the cache:

    sudo apt update
    
  5. Now we'll install MySQL Server.

    sudo apt install mysql-server
    
  6. When prompted, choose Y.

  7. Set the password for root. I recommend using student so that your codespace is consistent with the demos.

  8. Choose Use Legacy Auth.

  9. 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/