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

Code Example 1

GRANT type_of_permission ON database_name.table_name TO ‘username’@'localhost’;

Code Example 2

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

Learn ReactJs, React Native from akashmittal.com