Hi, I am geting this error message when i try to conncect database.
error message:SQLSTATE[HY000] [1045] ProxySQL Error: Access denied for user ‘id6769402_teoricenter’@‘2a02:4780:bad:f00d::f’ (using password: YES)
class Db_connection{
## this is for
public $host= ‘localhost’;
public $database= ‘id*******_korkort’;
public $user= ‘id*******_teoricenter’;
public $pass= ‘teoricenter****’;
public function connection(){
try{
$db = new PDO("mysql:host=$this->host; dbname=$this->database; charset=utf8;" ,$this->user, $this->pass);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, FALSE);
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
echo "Connected successfully";
return $db;
}catch(PDOException $e){
echo "Connection failed: ";
echo'<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">x</button>
<strong>error message:'.$e->getMessage().'</strong>
</div>';
}
}
}
this is my code, and i dont think there is a something wrong with that. With those username and password I can access to database and see my tables.
Did I miss something somewhere? is that something to do with privilegier? I am using free account and my own domain.
using Current version: PHP 7.0