Create MySQL user and database

Users can be created in several ways in MySQL. Eg. via phpMyAdmin or Command Line Client, which I prefer and will demonstrate.

Open up Command Line Client and enter your root password to login.

You should now get the welcome screen and be in mysql>_

We are now ready to create our database and associated user.

CREATE DATABASE mydatabase; [Enter]
GRANT ALL PRIVILEGES on mydatabase.* to myuser@localhost identified by ‘userpassword’; [Enter]
FLUSH PRIVILEGES; [Enter]

That’s it, you are now ready to use your database.
Usually I use domain_com as database and username for a better overview.