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 :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.