Failed to connect to MySQL SOLVED

I’ve read the list on how to set this up but im still receiving this error.

db.php

<?php // Enter your Host, username, password, database below. $con = mysqli_connect("sql{NUMBER}.byetcluster.com","USERNAME","PASSWORD","USERNAME_register"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } ?>

um some information are wrong i guess
look try to write this code

<?php // copy the code and fill these vars $servername = "sql204.epizy.com"; $username = "your login username"; $password = "your login password"; $dbname = "you database name u wanna connect with"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Yeah it's working"; } catch(PDOException $e) { echo "Failed To Connect " . $e->getMessage(); } ?>

Similar problem problem
_ = Hidden
failed To Connect SQLSTATE[] [] Access denied for user ‘epiz_NUMBERS’@‘192.168..__’ (using password: YES)

<?php $servername = "sql300.epizy.com"; $username = "epiz_NUMBERS"; $password = "PASSWORD"; $dbname = "epiz_NUMBERS_register"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Yeah it's working"; } catch(PDOException $e) { echo "Failed To Connect " . $e->getMessage(); } ?>

https://infinityfree.net/support/common-mysql-errors/

and please use code formatting tool
image

I can check this issue for you. What is the name of the database you’re trying to connect to?

I have just fixed it, (I guess I had the wrong password/or it changed) thanks non the less.

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