Difficulty:Beginner
Applies to:MySQL
 

Creating a MySQL user

 
Access MySQL (Enter mysql)
 
Type CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
 
Replacing newuser with the username you wish to use, the same with localhost using the server IP or server name and password with your desired password.
 
The newuser will have no permissions at first 
 
To give all permissions ->
 
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
 
Again replacing newuser and localhost
 
Once you have done this, to load the user with the new permissions ->
 
FLUSH PRIVILEGES;
 

Creating a MySQL Database

 
To create a database, it’s very simple -> create database db_name;
 
Replacing db_name with whatever name you want to use for the database.
 
You can then use -> show databases;
 
This will show all databases on the server using MySQL.