MySQL Connect

Hi. I have signed up to the Crazy Domain Insane deal, and I have set up a MySQL database. For some reason my PHP doesn’t want to connect to the database.

My php connection code is pretty standard, using mysql_connect().

Any help?

Also, to elaborate, here is the error I get:

Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) in /home/.emerson/uiv2/ on line 370

That error indicates that your PHP page is attempting to connect to a database server running on the local host through a Unix socket.

MySQL databases at Dreamhost are hosted on separate machines to the web server. You need to connect using a server name, username and password, e.g:

$db = mysql_connect(‘’, ‘username’, ‘password’);

Replace with the hostname you setup for your database in the panel.

I thought I already did that. Turns out i forgot about a second connection I made in the same script.

I plan to get rid of this connection now, I don’t need 2. Thanks alot :smiley: