SQLSTATE[HY000] [2002] No such file or directory

Username epiz_32209288) or Website URL

(please specify the website or account you are asking about)

Error Message

(please share the FULL error message you see)

Other Information

(other information and details relevant to your question)

Hi and welcome to the forum

when this is clicked

image

8 Likes

Please remember to fill out the topic template next time!

7 Likes

hello, good and followed the instructions that were recommended to me but it keeps throwing the same error.
DB Error!: SQLSTATE[HY000] [2002] No such file or directory

Please share your Database configuration file

3 Likes
<?php
session_start();
class Conectar {
	protected $dbh;
		protected function Conexion(){
			try {
				$conectar = $this->dbh = new PDO("mysql:local=sql303.epizy.com;dbname=epiz_32209288_mesadepartes","epiz_32209288","");
				
				return $conectar;	
			} catch (Exception $e) {
				print "¡Error BD!: " . $e->getMessage() . "<br/>";
				die();	
			}
		}
		
		public function set_names(){	
			return $this->dbh->query("SET NAMES 'utf8'");
		}

		public function ruta(){
			return "http://sql303.epizy.com:3306/mesa/";
		}
	}
?>

Replace this with "mysql:host

6 Likes

thank you very much I was able to enter now to work in the information base

2 Likes

“local” mean localhost. “host” means external db server. In a basic sense anyways.

2 Likes

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