QNAP mysqli_real_connect(): (HY000/2002): No such file or directory error

Problem

The mysqli_real_connect(): (HY000/2002): No such file or directory error is unfortunately a known issue since the QNAP QTS5 update.


Fix

Important, make sure that you are logged in as admin user and have the Text Editor app installed on your QNAP NAS.

Open "File Station" and navigate to "DataVol/Web/phpMyAdmin".



Right click on "config.inc.php" file and "Open with Text Editor"


Go to the line 31 and change $cfg['Servers'][$i]['host'] = 'localhost'; to $cfg['Servers'][$i]['host'] = '127.0.0.1';



After editing the file click on "File -> Save" to save the changes.



Wait 30 seconds, and now you should be able to login to phpMyAdmin.