create new user in mysql database userid code example
Example 1: how to create new database user
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
Example 2: assign user to database mysql
GRANT type_of_permission ON database_name.table_name TO ‘username’@'localhost’;