Good afternoon,
I am trying to connect my PHP project that is hosted on my CPanel website to the MySQL database that i have setup on CPanel's PHPMyAdmin however I can't. I think it is because i am using the incorrect username and password to access the CPanel database (The project was initially setup on XAMPP and all worked fine before i attempted to host it however the credentials were just 'root' and no password).
The error i'm getting is - Access denied for user 'warbi260_warbi26'@'localhost' (using password: YES)
My Connection Code:
<?php
$dsn = 'mysql:host=localhost;dbname=warbi260_Events-Website';
$user = 'warbi260_warbi26';
$password = 'PASSWORDFORUSERACCOUNTHIDDEN';
try {
$pdo = new PDO($dsn, $user, $password);
$pdo ->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo ->exec("SET CHARACTER SET utf8");
}
catch (PDOException $e) {
echo 'Connection failed again: ' . $e->getMessage();
}
?>
Steps I've tried:
Tried the steps in CPanel's "MySQL® Databases" section which you can see in the picture below
Tried my CPanel username and password.
Resetting my CPanel password

Sidenotes:
The user account warbi260_warbi26 has full privileges on the DB
PASSWORDFORUSERACCOUNTHIDDEN is the password that is set to the user account 'warbi260_warbi26' but is hidden for obvious reasons
Any help would be greatly appreciated as I've been at this for hours!
Thanks in advance,
Josh
I am trying to connect my PHP project that is hosted on my CPanel website to the MySQL database that i have setup on CPanel's PHPMyAdmin however I can't. I think it is because i am using the incorrect username and password to access the CPanel database (The project was initially setup on XAMPP and all worked fine before i attempted to host it however the credentials were just 'root' and no password).
The error i'm getting is - Access denied for user 'warbi260_warbi26'@'localhost' (using password: YES)
My Connection Code:
<?php
$dsn = 'mysql:host=localhost;dbname=warbi260_Events-Website';
$user = 'warbi260_warbi26';
$password = 'PASSWORDFORUSERACCOUNTHIDDEN';
try {
$pdo = new PDO($dsn, $user, $password);
$pdo ->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo ->exec("SET CHARACTER SET utf8");
}
catch (PDOException $e) {
echo 'Connection failed again: ' . $e->getMessage();
}
?>
Steps I've tried:
Tried the steps in CPanel's "MySQL® Databases" section which you can see in the picture below
Tried my CPanel username and password.
Resetting my CPanel password

Sidenotes:
The user account warbi260_warbi26 has full privileges on the DB
PASSWORDFORUSERACCOUNTHIDDEN is the password that is set to the user account 'warbi260_warbi26' but is hidden for obvious reasons
Any help would be greatly appreciated as I've been at this for hours!
Thanks in advance,
Josh