Course materials and documentation for DS2002
This guide walks you through setting up MySQL in a GitHub Codespace environment, including configuring prebuilds to speed up future Codespace startups.
The MySQL container requires a root password to be set via the MYSQL_PASSWORD environment variable. You need to add this as a secret in your GitHub repository settings so Codespace can access it.
Go to your forked repository on GitHub (e.g., https://github.com/YOUR_GITHUB_USERNAME/ds2002-course).
Click on Settings (in the repository navigation bar, not your general GitHub settings).
In the left sidebar, under Secrets and variables, click Codespaces.
Click New repository secret.
MYSQL_PASSWORDNote: Choose a secure password and keep it safe. You’ll need this password to connect to MySQL in your Codespace. The password is encrypted and only accessible to your Codespaces.

Select the Codespaces tab.
Next to "Codespaces: your workspaces in the cloud", click on the three dots "..." and select "+ New with options".

On the next screen, choose "DS2002 MySQL":

Click Create codespace.
Wait for the codespace to initialize (this may take several minutes).
mysql -h dbhost -u root -p
mysql>
Congratulations! You’re logged into the MySQL server.
exit and press Enter to return to the bash terminal.