Below are the steps to create a MySQL database and add a user
CREATE DATABASE testdb CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY 'sumthin' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'localhost' IDENTIFIED BY 'sumthin' WITH GRANT OPTION;
All commands are executed in the MySQL console.