mysql> create database dbname; Query OK, 1 row affected (0.02 sec) mysql> grant all privileges on dbname.* to 'username'@'%' identified by 'password'; Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on dbname.* to 'username'@'localhost' identified by 'password'; Query OK, 0 rows affected (0.00 sec)