Connection failed: SQLSTATE[HY000] [1045] ProxySQL Error: Access denied for user 'id2379720_jhapz'@'2a02:4780:bad:f00d::c' (using password: YES)


Hai there, I can’t connect to my database using this code:

<?php $servername = "localhost"; $username = "id2379720_jhapz"; $password = "*******"; try { $conn = new PDO("mysql:host=$servername;dbname=id2379720_db_test", $username, $password); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected successfully"; } catch(PDOException $e) { echo "Connection failed: " . $e->getMessage(); } ?>


Please be careful when posting this kind of code, as it contained your database password.


Try this:-


Hi @jhapz!

This means your database credentials are incorrect. Please make sure they are the same as the ones from 000webhost cPanel > Manage databases.

If you have forgotten your DB password please go to 000webhost cPanel > Manage databases > locate DB > Manage > Password and try to connect again with the new password.