MySQL: create user and DB, assign permissions, allow connection from any IP

CREATE SCHEMA db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL ON db_name.* TO 'username'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit;

See also MySQL: allow remote connections