Setup MySQL for development (Ubuntu 14.04)

Since I have repeatedly had to do this I figured it’s time to make a guide for it. In case the other ones disappear on the INTERNET. Some of the parts require some testing.

Italicized fields means you have to fill in whatever string you want in that field.

    Ubuntu 14.04

Installation (From what I recall)
sudo apt-get update
sudo apt-get install mysql-server

You will be prompted during the installation to set a password for the super user.

Running MySQL with super user privileges
mysql -u root -p
You will be prompted for a username and password

Create a New Database
CREATE DATABASE databasename;

Create a New User
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';

Enlist user to a specific database
GRANT ALL PRIVILEGES ON databasename.* TO 'newuser'@'localhost';
You can further specify the tables you want to give the user but I assume that most developers would be looking for that.

The privilege changes you made won’t be applied until you do the following
FLUSH PRIVILEGES;