MySQL problem

Soldato
Joined
15 Feb 2003
Posts
10,167
Location
Europe
Hi,

I am trying to install MySQL on my office mac.

I used the package from the mysql website but when I try to run mysql i get the error

Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Now looking in /tmp/ I can see that the file is actually there, so i'm guessing it must be a permissions problem.

Having no experience with macs, how do i fix this?

Thanks
 
Got to say, having a similar issue, and so far most google searching turned up no useful results. This is on Gentoo, bizzarly once the service is running, I am able to connect and edit the database via a web interface, however any command line attempts are blocked by the same msg.

I am sure this must be some security setting that I keep overlooking, any helpful hints are appreciated. If il somehow stumble onto a solution will post here.
 
rsatd, have you tried su'ing to the mysql user and logging in to setup access for other users (including root)? I can't remember exactly as it has been ages, but the portage package doesn't setup access for anyone but 'mysql' I think. Maybe apache.
 
i've tried runnning as sudo on the mac but I get the same results.

Apparently osx already has a msql user setup by deafult - but even following all the steps to recreate this user from scratch was futile.
 
rsatd, have you tried su'ing to the mysql user and logging in to setup access for other users (including root)? I can't remember exactly as it has been ages, but the portage package doesn't setup access for anyone but 'mysql' I think. Maybe apache.

Ah will try that, one other thought that crossed my mind was that the whole original problem started with me being an idiot, but in the end I may have somehow installed mysql (without apache) both from portage and from a downloaded source of xampp, that comes with mysql. It could be that the current mysql service that is running is not using the same configuration file as the xampp one, or rather when I start 'mysql' from command line it references the portage version rather then xampp one. Will have to have a look when il get home, thanks.
 
Check your permissions on /tmp - It's usually a case of this file not being created due to permissions which throws up that error.

Other option is do a clean reinstall.

Remove MySQL with your relavent package manager
Remove any old files - rm -rf /var/lib/mysql

then start over.
 
Ah will try that, one other thought that crossed my mind was that the whole original problem started with me being an idiot, but in the end I may have somehow installed mysql (without apache) both from portage and from a downloaded source of xampp, that comes with mysql. It could be that the current mysql service that is running is not using the same configuration file as the xampp one, or rather when I start 'mysql' from command line it references the portage version rather then xampp one. Will have to have a look when il get home, thanks.
"mysql" in the terminal should not matter with regards to config files, because that'll be the client, and the config files you mention are for the server.

Also don't forget to start the (gentoo) server process with "/etc/init.d/mysql start" and "rc-update add mysql default" to add it to the default runtime (i.e. so it starts when booted and stops cleanly when shutdown)
but you've already done that if you get incorrect login rather than could not connect error.
 
Well removing it and installing again seemed to help, it now starts :D
Though just re-emerging it seemed to do nothing before :o
 
Back
Top Bottom