CMPT 470, Fall 2012

Setting up MySQL

If you haven't already, you will need to install the MySQL server:

sudo apt-get install mysql-server

Make sure everyone in your group knows the MySQL root password, since they will likely all have to follow the rest of the instructions.

Start a database shell as root:

mysql -uroot -p

Then you can create the database and give appropriate permissions:

CREATE DATABASE myapp;
GRANT ALL PRIVILEGES ON myapp.* TO appuser@localhost IDENTIFIED BY 'secretpassword';

If necessary, you can connect to the database as your app's user to set things up:

mysql -uappuser -p myapp

… but likely your framework will take care of the rest of the database setup, once you give it the right username and password.

My MySQL commands from lecture may be useful as well.


Copyright © , based on content created by Greg Baker.