#create the new user CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; #create the new database CREATE DATABASE newdatabase; #assign the user to it GRANT ALL PRIVILEGES ON newdatabase. * TO 'newuser'@'localhost'; #flush FLUSH PRIVILEGES;