mysql create username and password and grant access to database code example
Example 1: create user mysql
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
Example 2: create mysql user with privileges
GRANT type_of_permission ON database_name.table_name TO ‘username’@'localhost’;