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'

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to Transfer Files Between Remote Systems?

This article will assist you to transfer web content between two remote Linux machines. cPanel...

How to change Database Collation in MySQL Server from phpMyAdmin?

Collation is a configuration level setting in the MySQL. It directs how the character data will...

How Much Email Disk Space Do I Get With Shared Hosting Plans?

Linux Shared Hosting   With Linux Shared Hosting plans, you don't have separate email...

When I connect to FTP account through filezilla it always says certificate is unknown. What am I missing here?

This error is common because FTP service of our shared server is bound with server's Self-Signed...

How to Add Domain Alias in WebsitePanel, cPanel and Plesk Panel?

This article describes how to add domain alias in WebsitePanel, cPanel and Plesk panel. Add...