Creates a new user (newuser) with the given password (pass1234), then creates a new database (newdb) and then grants all privileges on the new database to the new user. The user can login from localhost.
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'pass1234';
CREATE DATABASE `newdb` CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON `newdb`.* TO `newuser`@localhost;
FLUSH PRIVILEGES;