Access Denied - MySQL

My website URL is:

What I’m seeing is:
Personal Information edited out

$servername = "";
$username = "CPanelUsername";
$password = "CpanelPassword";
$dbname = "CPanelUsername_burn6r2v";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname); // fails here ultimately
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error); // returns access denied

The following Access Denied Mesaage is returned, I am using the same password as the Cpanel password and this is what I get:

Connection failed: Access denied for user 'CPanelUsername'@'' (using password: YES)

I’m using this software: Safari, Chrome, Firefox, phpMyAdmin, Cpanel tools

Additional information:
I also can no longer access phpMyAdmin either, it just returns a “Too Many Redirects Occured” error

For me it shows this error now:

Fatal error: Uncaught Error: Class ‘mysqli_connect’ not found in /home/vol13_2/ Stack trace: #0 /home/vol13_2/ include() #1 {main} thrown in /home/vol13_2/ on line 10

So you defined a new mysqli_connect object instead of using the mysqli_connect function to connect, and that will not be valid.

I was just testing something out. It should be back to the way it was now.

And now it throws this error:

Parse error: syntax error, unexpected ‘$servername’ (T_VARIABLE) in /home/vol13_2/ on line 10

So you didn’t define the variable $servername. Define it now.

It’s good, forgot to put the parenthesis back in, just confirmed it now.

Now follow this KB article and this other one for the errors you experience.

Ran through everything, and it is all correct.

Looks like my database permissions need to be reset for phpMyAdmin.

Tried the client area password and the main password I use to log into InfinityFree, same result.

I’ve reset your database permissions. Please check again in 15 minutes.

1 Like

It’s all fixed now, thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.