MySQL. UTF-8 database creation snippet

Well, I haven't remembered syntax of database creation in UTF-8 character set with MySQL for quite a long time. Finally I decided to write a little snippet because I used it so often last time.

CREATE DATABASE database CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON database.* TO 'username'@'localhost';
Tagged as : Linux SQL