Error connecting mysql

Hi!

First of all, I´ve read other posts in forum as well document in knowledge base about MySQL connect error.

Second: I check my account password, database name, user, many times.

However, I getting this error: Connection failed: SQLSTATE[HY000] [1045] Access denied for user ‘epiz_24625864’@‘192.168.0.67’ (using password: YES)

I´m using this code:

<?php
$servername = "sql206.epizy.com";
$username = "epiz_24625864";
$password = "password";  //it´s not the real password
$dbName = "databasename"; //it´s not the real name

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 "Connected successfully";
    }
catch(PDOException $e)
    {
    echo "Connection failed: " . $e->getMessage();
    }
?>

Can someone help me?

There was a problem with the permissions of your database. I’ve reset the your database permisisons now. Can you please check if your script works now?

2 Likes

It works now! Thanks!!!