views:

36

answers:

2

Hi,

I have apache and mysql set up on my local machine (Mac).

Whenever I go to any of my local sites I get the "Error establishing a database connection" whenever anything mySql related happens.

It was working perfectly yesterday, but when I started my computer today it is not.

I can login to mysql on the terminal and that all works fine, I can view database and run queries in the terminal. Look at all my table etc.

I've tried restarting apache.

Anyone know what's up? This is worrying.

UPDATE...

It is somthing in my php.ini file, if I restore the default one it all works fine and dandy again. What in there could be doing it?

A: 

I know this isn't an answer to the specific question, but it is rather a suggesting IF you are just doing development on your box. I would suggest skipping all the configurations and go with MAMP

Flash84x
Naaa mamp messes with stuff and isn't as elegant, also I have rails running sometimes which might interfere with it.
Smickie
+1  A: 

The problem was in php.ini, I needed to set:

mysql.default_socket = /path_to_file/mysql.sock

Smickie