Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ed91

macrumors 6502
Original poster
Dec 22, 2007
267
1
Hey, I'm looking for a little help setting up MySQL to work with my current web development setup which is just PHP / Apache at the moment, and works just how I want it to (using the installs supplied with the OS).

However, after installing MySQL, I'm not really sure what I need to change to get it working with PHP. If I try to connect to a database through a simple PHP script, I get the error:


Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Users/dev/Sites/testing/mysql.php on line 6
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)

Now, I know that I don't have a "mysql" folder in /var/ so I'm guessing PHP is looking n the wrong place. Am I right? If so, how do I change the settings so that PHP can find/connect?

Thanks in advance for any help you guys can offer :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.