Login to mysql shell and key in :

For Local users
 
mysql> grant all on database.* to username@’localhost’ identified by ’password’;
mysql> flush privileges;
 
Verify the connection by executing the command from bash prompt: 
 
mysql -u username -p databasename
 
For remote users :
 
mysql> grant all on database.* to username@’%’ identified by ’password’;
mysql> flush privileges;
 
Verify the connection …