Specifying MySQL Port and Socket By Paul Dec 05, 2007 (Edited Feb 01, 2014)
Although extremely unlikely, it's possible you might run into a web server where you can't connect to the database with just the host name, username, password and database name. This may be because it requires a special socket. Open config.php and change
$adb = new db($dbhost, $dbuser, $dbpass, $databasename);
to
$adb = new db($dbhost, $dbuser, $dbpass, $databasename, 3306, '/tmp/mysql5.sock');
where 3306 is your port name and /tmp/mysql5.sock is the socket (these values are specific to your host). This will fix the problem, if you use the correct port number and socket name.
Description
What to do on an unusual host which doesn't handle port and socket properly automatically.