MySQL : Access denied for user 'Mysql_dbuser'@'localhost' (using password: YES) in /home/cPanel_user/public_html/file path.php

You may face this error while using mysqli_connect function on your website.

Cause :

This may be an issue with all privileges of your mysql db user on database.

Fix :

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.

  1. Login to your cPanel.

  2. Click on MySQL Databases.



  3. Go to Add User To Database section. Select your user and database in respective Drop-down and click on Add Button.



  4. 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'

Related Articles

How do I add new domain in Linux Shared Hosting plan?

You can add new domain to multiple domain Linux Shared Hosting plan through "Addon Domain"...

How many IP addresses do you offer with Shared Hosting Account and a VPS Account?

We do not offer any dedicated IP address with shared hosting plans. If you purchase SSL...

What is the path to sendmail in Linux Shared Hosting?

The path to send email is /usr/sbin/sendmail.Note: It is recommended to use bulk email validation...

Do you provide Remote MySQL in Linux Shared Hosting?

No. Due to security reasons, we do not provide remote MySQL in Linux Shared Hosting. If you need...

How to manage DNS of addon domains in cPanel?

When you create the addon domain in cPanel, it will create the appropriate DNS zone for your new...

  • 0 Users Found This Useful

Was this answer helpful?