We will use MariaDB as the relational database for this course. MariaDB is an open-source fork of MySQL and we will use the
mysql client to connect to this database from a CS vlab computer.
And several useful references, including:
Everyone has been assigned a database account on our lab MySQL/MariaDB database server.
The database accounts are in the form
### is a number between
100. The database for that account is the same as the username.
See which database account you have been assigned on the Database Accounts Canvas page. Your initial password will be your USF username. Make sure to change your password after logging in for the first time.
Connecting to Database
First, log into one of the CS vlab computers. See the Using CS vLab Computers guide for details.
Then, you will need to run the
mysql command to connect to the database. The command looks like:
Hint: You can edit the text above to replace
user### with your database account before copying/pasting the command.
Here is what each part means:
mysqlpart runs the MySQL client command-line tool.
-h sql.cs.usfca.eduspecifies the hostname of our database server. You can actually type
-h sqland the
cs.usfca.edupart will be assumed when you are on the CS lab network.
-u user###part will specify the database account username. This is different from your CS or USF usernames. See the Database Accounts page for your assigned database account and replace
user###with your database username.
-D user###part specifies the specific database to use. You only have one database for this class, and it has the same name as your database account username.
--password) at the end will cause
mysqlto prompt you for a password once you hit Enter. Remember, you will not see the characters you type for your password for privacy reasons.
You may want to load some of the examples discussed in class into your own database. This can be done using the
SOURCE command in the