set permissions mysql code example
Example 1: mysql user permission database
GRANT ALL PRIVILEGES ON `db_name`.* TO 'user'@'host'
Example 2: how to add privilege in mysql user
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON `db_name`.* TO 'user'@'host'
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';