mysql_connect() can’t connect through socket
-
I’m on Media Temple, installing the alpha, I have the correct database name, username and password, here’s the error:
Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) in /nfs/c02/h04/mnt/41093/domains/satnightspecials.com/html/bb-includes/backpress/class.bpdb.php on line 123
Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) in /nfs/c02/h04/mnt/41093/domains/satnightspecials.com/html/bb-includes/backpress/class.bpdb.php on line 123
Warning: Cannot modify header information – headers already sent by (output started at /nfs/c02/h04/mnt/41093/domains/satnightspecials.com/html/bb-includes/backpress/class.bpdb.php:123) in /nfs/c02/h04/mnt/41093/domains/satnightspecials.com/html/bb-includes/functions.bb-core.php on line
—
I solved this by editing that line 123. Go to MT’s “Server Guide: Overview” page and copy the “Internal Hostname” under the “Database” subheading, then edit line 123 to look something like this:
$this->dbh = mysql_connect(“internal-db.s41093.gridserver.com”, $user, $password, true);
Worked for me.
- You must be logged in to reply to this topic.