CREATE DATABASE databasename;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON databasename.* TO 'username'@'localhost';
DROP USER 'username';
mysqldump -u username -p databasename > export.sql
mysql -u username -p databasename < filename.sql