You may face this error while using mysqli_connect function on your website.
This may be an issue with all privileges of your mysql db user on database.
You can fix this issue by entering the command through ssh or from cPanel.
(1) Command Line :
Below command will provide all the privilages to user on the database
grant all on .* to [email protected]; flush privileges;
(2) cPanel :
Please refer to the; below steps to fix this error if you have cPanel at your end.
- Login to your cPanel.
- Click on MySQL Databases.
- Go to Add User To Database section. Select your user and database in respective Drop-down and click on Add Button.
- Tick on All Privileges and click on Make Changes Button. It will provide all the permission for your database user to your database.
This should fix your issue of Access denied for user 'Mysql_dbuser'@'localhost'