Skip to main content
Inspiring
January 27, 2008
Question

Leopard MySQL help

  • January 27, 2008
  • 4 replies
  • 1310 views
Hi Folks,

After upgrading to Mac OSX 10.5 (Leopard) I discovered I could no longer connect to MySql. I immediately searched the web for a fix and found a few different posts offering solutions. No doubt due to my own lack of knowledge the terminal on the other 'black arts' I was encouraged to delve into along the way, every post I followed failed to solve my problem.
I'm sure it's all messed up behind the scenes now as I've dipped into all kinds of things trying to fix MySQL. The result is that when I try to connect through Cocoa MySql which was my tool of choice on OSX10.4 I get the following message:
"Unable to connect to host localhost.
Be sure that the address is correct and that you have the necessary privileges.
MySQL said: Can't connect to local MySQL server through socket '/private/tmp/mysql.sock' (2)"

I even tried MAMP which seemed to connect through PHPMyAdmin on the first try but following that I get this message:
" #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured) "

I hate to ask but I really have tried everything over the past month (over and over again) and I seem to have run out of options. Does anyone has the time to help me find a solution?

Cheers


Dave
This topic has been closed for replies.

4 replies

Participating Frequently
September 13, 2008
I am a newb at this stuff, but I also got the " #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured" error. I read the above posts and entered the commands:
sudo mkdir /var/mysql
sudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock

And got back this:

Randy-Computer:~ randy$ ln -s
/var/run/mysqld/mysqld.sock /tmp/mysql.sock
ln: /tmp/mysql.sock: File exists
Randy-Computer:~ randy$ sudo mkdir /var/mysql
mkdir: /var/mysql: File exists
Randy-Computer:~ randy$ sudo ln -s/privatesudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock
ln: illegal option -- /
usage: ln [-Ffhinsv] source_file [target_file]
ln [-Ffhinsv] source_file ... target_dir
link source_file target_file
Randy-Computer:~ randy$

Can anyone tell me what this means and how I can fix it?

Thanks
Randy


January 28, 2008
This fix worked for me:

sudo mkdir /var/mysql
sudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock
Inspiring
January 28, 2008
Thanks guys,

I tried both those options and nothing changed. Checking on a phpinfo.php doc readout the mysql default socket is still /var/mysql/mysql.sock.

I have changed the php.ini file to teh default socket you suggested, but the php info readout still remains unchanged. However, when I check the path to the php.ini file in the phpinfo readout it says the path is "/etc". Maybe that's my probelm?

I checked and there is a php.ini in "etc" but when I opened that I found the mysql default socket IS set to /private/tmp/mysql.sock.

I feel that at least I'm starting to understand what all this is about and we may be approaching a solution but I'm afraid I'll still need a little help form you guys if I'm going to unravel this mystery.

What should I do next?

Cheers

Dave
davecheetAuthor
Inspiring
February 3, 2008
Thanks Carlo,

That has helped me out. Now when I check on phpinfo the MySQL.default_socket is "private/tmp/mysql.sock".
However, above that phpinfo also tells me that MySQL SOCKET is /var/mysql/mysql.sock

I still can't connect to MySQL via anything, but I feel I must be getting closer.

Do I need to change the MySQL SOCKET somehow?


I still can't figure this out. Has anyone got any ideas what I should do next?

Cheers

Dave
January 27, 2008
I'm having the same problem and none of the "fixes" suggested here work. Mick, your suggestions returns "ln: /tmp/mysql.sock: File exists".
davecheetAuthor
Inspiring
January 27, 2008
Thanks for your help guys,
Uunfortunately not much has happened yet.

Mick, when I input your suggestion to the terminal get the following response:

ln: /tmp/mysql.sock: File exists

I'm sure it's all there waiting to work in the background but I just never seem to quite get it 'hooked up'.

Any more help would be greatly appreciated because I'm way of of my depth here.

Cheers

Dave

Inspiring
January 27, 2008
davecheet wrote:

> Hi Folks,
>
> After upgrading to Mac OSX 10.5 (Leopard) I discovered I could no longer
> connect to MySql. I immediately searched the web for a fix and found a few
> different posts offering solutions. No doubt due to my own lack of knowledge
> the terminal on the other 'black arts' I was encouraged to delve into along the
> way, every post I followed failed to solve my problem.
> I'm sure it's all messed up behind the scenes now as I've dipped into all
> kinds of things trying to fix MySQL. The result is that when I try to connect
> through Cocoa MySql which was my tool of choice on OSX10.4 I get the following
> message:
> "Unable to connect to host localhost.
> Be sure that the address is correct and that you have the necessary privileges.
> MySQL said: Can't connect to local MySQL server through socket
> '/private/tmp/mysql.sock' (2)"
>
> I even tried MAMP which seemed to connect through PHPMyAdmin on the first try
> but following that I get this message:
> " #2002 - The server is not responding (or the local MySQL server's socket is
> not correctly configured) "
>
> I hate to ask but I really have tried everything over the past month (over and
> over again) and I seem to have run out of options. Does anyone has the time to
> help me find a solution?
>


"mysql.sock" may be missing or in the wrong directory:
http://forum.mamboserver.com/showthread.php?t=70766

Or per Dave Powers:
Try this in Terminal:

ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

Mick