You may face this error while using the mysqli_connect function on your website.
Cause
This may be an issue with all privileges of your MySQL DB user on the database.
Fix
You can fix this issue by entering the command through SSH or cPanel.
(1) Command Line
The command given below will provide all the privileges to a user on the database –
grant all on .* to mysql_user@localhost; flush privileges;
(2) cPanel
Please refer to the steps given below to fix this error if you have cPanel access –
1. Log in to your cPanel.
2. Click on MySQL Databases.
3. Go to the Add User to Database section.
Select your user and database in your respective drop-down and click the Add button.
4. Tick on All Privileges and click on the Make Changes button.
It will provide all the permission for your database user to access your database.
This should fix your issue of Access Denied for user 'Mysql_dbuser'@'localhost.'