get user and privileges mysql code example
Example 1: mysql check user privileges
SHOW GRANTS FOR 'root'@'localhost';
Example 2: create mysql user with privileges
GRANT type_of_permission ON database_name.table_name TO ‘username’@'localhost’;
SHOW GRANTS FOR 'root'@'localhost';
GRANT type_of_permission ON database_name.table_name TO ‘username’@'localhost’;