mysql create user and grant permissions to database code example Example: mysql user permission database GRANT ALL PRIVILEGES ON `db_name`.* TO 'user'@'host'