Last active
January 29, 2016 18:28
-
-
Save mwleeds/98ceeb46a970c6668d82 to your computer and use it in GitHub Desktop.
Instructions for setting up an example MySQL database on Ubuntu/Debian for CS 457 at UA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install the MySQL client and server software (on Ubuntu/Debian) | |
sudo apt-get update && sudo apt-get install mysql-client mysql-server | |
# you'll set a root password for the server instance and the mysql service should start on localhost | |
# you can also install the mysql-workbench package if you want a GUI | |
# download the CompanyDB.DDL.txt file from the website and rename it | |
wget -O - http://cs457.cs.ua.edu/CompanyDB.DDL.txt > CompanyDB.DDL.sql | |
# Connect to your server (enter the root password at the prompt) | |
mysql --host=localhost --user=root -p | |
# Now you should have a mysql> prompt. | |
# mysql> CREATE DATABASE cs457; | |
# mysql> USE cs457; | |
# mysql> source CompanyDB.DDL.sql; | |
# Now you can execute queries such as SELECT... | |
# control the server process with "sudo service mysql [stop|start|status|restart]" | |
# Execute "man mysql" for more info. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment