j'ai un domaine chez OVH
un hébergement mutualisé perso 2014
j'ai un script de connexion à la base de données qui me régénère l'erreur suivante:
Erreur : SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
voici mon script
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
function connexion(){
	try{
		global $bdd;
		$bdd = new PDO('mysql:host=nom_server;dbname=nom_bd','user','password');
		 // $bdd = new PDO('mysql:host=localhost;dbname=bd_ceretour','root','');
		return $bdd;
	}
	catch (Exception $e){
		die('Erreur : ' . $e->getMessage().$bdd->errorInfo());
		return false;
	}
}
J'ai beau cherché mais je ne sais pas où se trouve l'erreur