Fatal Error: Uncaught mysqli_sql_exception: No Such File or Directory

Fatal Error: Uncaught mysqli_sql_exception: No Such File or Directory

I use the following programs for the purpose of creating a website (infinityfree, wampserver3.3.7 / MyPHPAdmin, Cyberduck, and Visual Studio Code).

I have created a website and it works locally. When I tried to upload the documents to cyberduck, my website (Read more) / http://ea2914snkla.infinityfreeapp.com/project3website/list_songs.php) produces a 'fatal error'.

Here is the error it produces: Fatal error: Uncaught mysqli_sql_exception: No such file or directory in /home/vol13_2/infinityfree.com/if0_38722082/htdocs/project3website/mysqli_connect.php:5 Stack trace: #0 /home/vol13_2/infinityfree.com/if0_38722082/htdocs/project3website/mysqli_connect.php(5): mysqli_connect('localhost', 'root', Object(SensitiveParameterValue), 'topcountry') #1 {main} thrown in /home/vol13_2/infinityfree.com/if0_38722082/htdocs/project3website/mysqli_connect.php on line 5

I have no idea how to resolve this or what is happening. It references my Infinityfree account, but the mysqli_connect relates to my MyPHPAdmin database..

I am a complete newbie and all of this seems so overwhelming so any laymans advice is greatly appreciated!

Answer

base on the error you post its all about connection parameter kindly check all those
parameter. try it first on your localhostand put the ip / host , username and password
and test it. important note that you should put the ip host live instead of localhost

example query connection php mysqli

$mysqli = new mysqli("127.0.0.1 or IP","user","password","db");

// Check connection
if ($mysqli -> connect_errno) {
  echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
  exit();
}

Enjoyed this article?

Check out more content on our blog or follow us on social media.

Browse more articles