Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Leopard MySQL help

Participant ,
Jan 27, 2008 Jan 27, 2008
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
TOPICS
Server side applications
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 27, 2008 Jan 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 27, 2008 Jan 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".
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 27, 2008 Jan 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 27, 2008 Jan 27, 2008
davecheet wrote:

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

Have you checked to see that the php.ini file points mysql.sock to
correct location?

"Or you can update your php.ini (.default) by finding
"mysql.default_socket" and setting it to equal /private/tmp/mysql.sock
and then restart apache with "apachectl graceful"

Daivid P. is far more knowledgable than I am in this area, I hope he
chimes in.

Mick
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 27, 2008 Jan 27, 2008
This fix worked for me:

sudo mkdir /var/mysql
sudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 28, 2008 Jan 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 28, 2008 Jan 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 the 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 30, 2008 Jan 30, 2008
I also tried this:

sudo mkdir /var/mysql
sudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock

and it fixed my problem. Make sure you are entering the command correctly (copy and paste is the best way).

good luck
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 31, 2008 Jan 31, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 03, 2008 Feb 03, 2008
I still can't figure this out. Has anyone got any ideas what I should do next?

Cheers

Dave
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 05, 2008 Feb 05, 2008
Okay. No suggestions.

Assuming I've hit a brick wall, can anyone tell me how I can uninstall MySQL completely so I can start again?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 05, 2008 Mar 05, 2008
Dave, you're gonna shoot yourself for not doing this...Okay, what the guy said fixes the problem :

sudo mkdir /var/mysql
sudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock

you just have to refresh everything. The quickest way I did this was to goto System Preferences > Sharing. Uncheck, then check "Web Sharing". Hope this helps!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 13, 2008 Sep 13, 2008
LATEST
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


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines