Forum

You are not logged in.

#1 08-12-2017 18:20:38

stupa
Membre
Registered: 08-12-2017
Posts: 1

Mysql Connection issue 2002 No such file or directory

Hello everyone

Here is my probelm, I am trying to connect into my database with this php script

<?php
$dsn = 'mysql:dbname=stupa_buyke;host:mysql-stupa.alwaysdata.net';
$user = 'stupa';
$pass = 'That's a secret wink';
try{
    $bdd = new PDO($dsn, $user, $pass);
}catch (Exception $e){
    echo $e->getMessage();
}
?>

But when I run the script, it is said "No such file or directory", and I don't understand what's going on, because when I am using a local database, the script works perfectly.

thank you in advance for you help ^.^
Rémi

Last edited by stupa (08-12-2017 18:27:27)

Offline

Board footer

Powered by FluxBB