Simple commands:

CREATE DATABASE TheDatabase;

CREATE USER ‘UserName’@’localhost’ IDENTIFIED BY ‘ThePassword’;

GRANT ALL PRIVILEGES ON TheDatabase.* TO ‘UserName’@’localhost’;

FLUSH PRIVILEGES;

Scripted:

Create Creation.sql file with previous commands and then execute:

sudo mysql < Creation.sql