I came across this error today:
Attempting to connect to database as admin
BAD.
Does administrative user have access to the database? ( No such file or directory )
Eventually tracked down that I had 'localhost' set as the g_hostname in my config file, and the database server wasn't running. The "file" that doesn't exist is mysql.sock which is normally /var/lib/mysql/mysql.sock.
In my configuration (RHEL7) I was able to fix this by 'yum install -y mariadb mariadb-server' and 'systemctl start mariadb.service' but obviously those exact commands will be different in different circumstances.
I'm posting this because the OP from 3 years ago never got a proper reply and "No such file or directory" is a really sucky error for a non-expert to have to decipher when attempting to connect to a database. Furthermore here's a short php code that can be installed into "mantisbt" as dbtest.php and run via
http://localhost/mantisbt/dbtest.php.
<?php
echo "Running... ";
include("./vendor/adodb/adodb-php/adodb.inc.php");
$db = NewADOConnection('mysqli');
$db->debug = true;
$db->Connect ( 'localhost', 'mantisuser', 'secretpassword' );
$result = $db->isConnected();
if ($result === false) die("failed");
echo $result;
echo " Successful.. Done<br>";
?>