My sql host

(please specify the URL of the site on which you are experiencing the problem)

Error Message

Uncaught mysqli_sql_exception: No such file or directory in /home/vol6_4/ Stack trace: #0 /home/vol6_4/ mysqli_connect(NULL, ‘if0_35916442’, Object(SensitiveParameterValue), ‘if0_35916442_wa…’) #1 {main} thrown in /home/vol6_4/ on line 8

Other Information

Even after putting the sql host name the php file takes it as null, why is this error encountered?


Can you show us the code that you are using to connect to MySQL? Please do cover any sensitive information.


There is exactly one reason why you may see a “No such file or directory” error when connection to MySQL: it’s because localhost is being used as the database hostname. There is no other way this can happen.

This could be because you didn’t configure the MySQL hostname correctly, or because the configuration isn’t being fed correctly into every MySQL connection everywhere in your code.

Speaking of which:

The first parameter of mysqli_connect should be the hostname. You are setting this to NULL. Null means that the default value is used, which is localhost, which is why you see the error.

Please check your code and make sure that the database hostname you have configured is also actually being used in your code.


I see this

Please correct your error

Please post your error in full next time


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