Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Problem with MySQL and default socket location

Problem with MySQL and default socket location
Thread Tools
Fresh-Faced Recruit
Join Date: Apr 2007
Status: Offline
Reply With Quote
May 30, 2007, 08:01 AM
 
I recently installed the last version of MAMP in my iBook G3. Everything worked just out the box, including mySql server.

Then I downloaded and installed mySql Client tools. When tried to connect to mySql server from MySql Administrator I got this error:

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

The problem comes becauses the actually socket file is found at /Applications/MAMP/tmp/mysql/mysql.sock.

If I put the real socket location when connecting from Administrator, it works fine. But I want to configure it to avoid writing the full path all the time.

As far as I can see, this can be done thru mySql Administrator Preferences... the problem is that the first time I entered the preferences dialog it said the file /etc/my.cnf doesn't exist and asked me to create it. I said yes and then the preferences dialog showed but all configurations appears marked as read-only.

I opened a terminal window and checked out /etc/my.cnf and it is marked as readonly. I tried to change this by CHMOD 600 my.cnf, CHMOD 777 my.cnf and CHMOD +RW my.cnf but ALL failed because the same reason: permission denied, although I was logged as an admnistrator user.

What I'm doing wrong here?
     
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
May 30, 2007, 09:11 AM
 
You need to use 'sudo' to alter files that are owned by the system.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
May 30, 2007, 10:51 AM
 
You can create override defaults for your account by adding the proper socket info into a .my.cnf file, stored in your home directory:

MySQL AB :: MySQL 5.0 Reference Manual :: 4.3.2 Using Option Files


You don't need escalated privileges to setup defaults in this file, but this will only work for your account. Your global /etc/my.cnf file can be used to set global defaults. All MySQL clients should read your ~/.my.cnf file, although some may look for your global my.cnf in different paths.

I'd suggest starting with a .my.cnf in your home directory.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:28 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2