give user permission to database mysql code example
Example 1: mysql user permission database
GRANT ALL PRIVILEGES ON `db_name`.* TO 'user'@'host'
Example 2: change permission to database mysql
UPDATE mysql.user SET Host='%' WHERE Host='localhost' AND User='username';
UPDATE mysql.db SET Host='%' WHERE Host='localhost' AND User='username';