Dingbats Posted December 22, 2006 Share Posted December 22, 2006 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 :) Quote Link to comment Share on other sites More sharing options...
fenway Posted December 22, 2006 Share Posted December 22, 2006 I wish I could, but I'd just be rehashing all of the steps described therein.... Quote Link to comment Share on other sites More sharing options...
Dingbats Posted December 23, 2006 Author Share Posted December 23, 2006 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! :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.