Can't connect to local MySQL

software development


Hi There

I am not a programmer and would very much appreciate help on the following matter. Please bare with me as if i do not using the right lingo.

I have a client who would like to transfer their web hosting to dreamhost. Their current URL is and i have temporarily created a mirror site with all the files here:

I also set up a Mysql database and uploaded all the files without error.

I was given the SQL dump and I imported it using MySql. It said it imported successfully. However when I view the website ( I get a lot of error messages mainly saying "Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ "

Does anyone kno what this means and how I can solve this matter. Is it a question of configuring my dreamhost account?

Please any help would be much appreciated




it’s a question of configuring your script to connect to the database. Are you using ‘localhost’? Make sure that you’ve set your script to connect to the hostname and database name, user, and pass you set up for it through the panel.

–Matttail - personal website


Hi Matttail

Thank you for reply so quickly. Where would I configure the script that connects to the database. Would it be within the html page or would I be using the control panel of dreamhost?



I got it to work after a lot of trial and error



That’s the best way to learn. :slight_smile:

yerba# rm -rf /etc