Grant Permissions to a MySQL User Via Command - Fix Access Denied for User
If you get a permission error while accessing MySQL Database? Use the following sql command to fix privilege issues.
GRANT ALL ON database_name TO 'user_name'@'localhost';
When finished making your permission changes, it’s good to reload all the privileges with the flush command!