GRANT ALL ON *.* to user@'%' IDENTIFIED BY 'password'; code example
Example: assign user to database mysql
GRANT type_of_permission ON database_name.table_name TO ‘username’@'localhost’;
GRANT type_of_permission ON database_name.table_name TO ‘username’@'localhost’;