Check out example codes for "mysql user access to database". It will help you in understanding the concepts better.

Code Example 1

GRANT ALL PRIVILEGES ON dbTest.* To 'user'@'hostname' IDENTIFIED BY 'password';

Code Example 2

mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';

Code Example 3

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';

Learn ReactJs, React Native from akashmittal.com