Jump to content

[SOLVED] "Can't connect to local MySQL server" etc. and I have read the manual


Dingbats

Recommended Posts

I've searched the forum for this but all threads with someone having this problem are basically just answered with "read [url=http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html]this[/url]". So I read that page thoroughly but it still doesn't solve my problem.

So the thing is I'm trying to connect to the MySQL server with

[code]$con = mysql_connect("localhost", "root", "");[/code]

I get the error message "Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Library/WebServer/Documents/dictionary/list.php on line 2". I'm on Mac OS X 10.4.8. The MySQL server is running. The socket file is in /tmp/mysql.sock, and /etc/my.cnf also points the socket to that folder, so it's weird that it says that it can't connect through /var/mysql/mysql.sock. When I change my.cnf to point the socket to the folder the error message says it should be in the MySQL server won't start.

Can someone tell me something more useful than "read the manual" to help me solve this problem?

Thanks a lot :)
I got help in another forum with this, so now it's solved. The thing was that I had to make a link that directs all accesses to /var/mysql/mysql.sock to point to /tmp/mysql.sock. Now it works and I'm happy! :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.