If you want to create a user and give it permissions to a specific database you can use these commands
CREATE USER 'myusername'@'localhost' IDENTIFIED BY 'mypass';
If you are using a existing user you might want to remove its access to other databases with this command. If you only invoked the previous command you can skip this step
REVOKE ALL PRIVILEGES,GRANT OPTION from myusername;
The following command will give the user all rights to a specific database:
GRANT ALL ON databasename.* TO 'myusername';
Thats it. You can test if it worked by logging in to mysql using command line (or a program like phpmyadmin) like this:
mysql -u myusername -p
Now enter the password from the user and do:
show databases;
You will now only see the database the user has access to and the information_schema database
