GRANT command is be used for giving privilege to any user for accessing database.
GRANT PRIVILEGES ON DATABASE OBJECTS TO USER@HOST IDENTIFIED BY āPASSWORDā;
Example:
For grantingĀ privilege to user Ā adminĀ Use:
GRANT ALL PRIVILEGES ON *.* TO āadmin@localhostā IDENTIFIED BY āsecretā;
For specifying the username and password which is used while staring MySQL is:
mysql āh hostname āu username āp password
When you donāt want users to access any other database tables then replace* (as shown below) with database name of that particular user whom you want to limit access to other database tables:
GRANT ALL PRIVILEGES ON āstoreā.* TO āadmin@localhostā IDENTIFIED BY āsecretā;
Run given command with root permission. In the given command āstoreā correlates to the name of database to which the privileges are assigned.

