Mac OS X keeps deleting my /tmp files (mysql.sock)

Mac OS X keeps deleting my /tmp files (mysql.sock)

Post by DC » Thu, 18 Jan 2007 12:54:26


So I've been trying to install MySQL 5 on Mac OS X 10.4.8 (using the
5.0 x686 installer) and everytime I exit out of the shell (or it might
be after I restart my computer), mysql.sock from /tmp keeps getting
deleted, which requires reinstalling mysql...How do I prevent this from
happening?
 
 
 

Mac OS X keeps deleting my /tmp files (mysql.sock)

Post by addinal » Thu, 18 Jan 2007 13:14:57


Edit the /etc/my.cnf file

[mysqld]
socket=/var/mysql/mysql.sock
[client]
socket=/var/mysql/mysql.sock

Cheers,
Mark Addinall.

 
 
 

Mac OS X keeps deleting my /tmp files (mysql.sock)

Post by nospa » Thu, 18 Jan 2007 15:44:19


After all, files in /tmp are *SUPPOSED* to get deleted on restart. It is
called tmp for a reason - it is temporary. There have been operating
systems where /tmp wasn't even on physical disk, but was in ram.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
 
 
 

Mac OS X keeps deleting my /tmp files (mysql.sock)

Post by D P Schreb » Thu, 18 Jan 2007 20:18:21

["Followup-To:" header set to comp.sys.mac.system.]

No need to do this.



The OP's premiss is wrong: it's perfectly normal for mysql.sock to go
away, like any other unix socket. Its disappearance on reboot causes no
problems and for sure doesn't require reinstalling MySQL.
 
 
 

Mac OS X keeps deleting my /tmp files (mysql.sock)

Post by Tom Reingo » Fri, 19 Jan 2007 00:34:46


And it's possible that his difficulty is that mysql doesn't start up on
bootup and he thinks his only remedy is to install. Probably, the trick
is to figure out how to start mysql on bootup. But I agree with D P
Shreber: you wouldn't want that file to stick around. It would cause
problems if it did. So don't' edit the /etc/my.cnf file. Instead,
figure out what's really wrong. What symptoms are you seeing that
misleads you into reinstalling?

Tom Reingold
Noo Joizy
 
 
 

Mac OS X keeps deleting my /tmp files (mysql.sock)

Post by D P Schreb » Fri, 19 Jan 2007 01:00:03


The MySQL installer should include a StartupItem (they haven't converted
to launchd yet), and should also install a System Preference to enable
or disable it, by changing the value of an environment variable in
/etc/hostconfig. Possibly the StartupItem isn't installed by default -
I don't remember anymore, since I did it so long ago.
 
 
 

Mac OS X keeps deleting my /tmp files (mysql.sock)

Post by DC » Fri, 19 Jan 2007 02:00:49

Thanks for the help and comments folks..I'm relatively new to OS X and
Unix...

1. I've been reinstalling because I haven't been able to get MySQL to
find the socket...even after editing the my.cnf as stated in the above
posts. Is the my.cnf file empty upon a default installation? Because it
always is when I install mysql.

2. There is a StartupItem pkg that comes with the installer...I did
install that on a couple reinstalls...I've had various problems running
MySQL besides the socket error, and haven't done a good job of figuring
out what actions lead to what, so I'll try this again now that I'm a
little more familiar.
 
 
 

Mac OS X keeps deleting my /tmp files (mysql.sock)

Post by DC » Fri, 19 Jan 2007 02:29:58

Well the inability of Mysql to find the socket file, and the inability
of myself to find a solution after searching for answers...I must be
doing something fundamentally wrong. I just cleaned out the mysql
directories and resinstalled, this time with the startup item also.

I followed the directions in the installer's readme, and I edited my
my.cnf as suggested...so this is the error message I'm getting:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/mysql/mysql.sock' (13)

So my question is...isn't running the Mac installer enough? Shouldn't
everything run fine by default? Or am I missing some undocumented step?
As I said, my installations do run fine until reboot and tmp
clears...but I haven't figured out how to find mysql.sock afterwards.
Editing my.cnf doesn't appear to work.
 
 
 

Mac OS X keeps deleting my /tmp files (mysql.sock)

Post by D P Schreb » Fri, 19 Jan 2007 03:33:46


Yes, it's typically empty. It only needs data in it if you want to use
non-standard settings. You don't -- forget the earlier suggestion about
changing this file.



You should also open System Preferences and look at the MySQL section.



The more specific you can be with error reports, the better.
 
 
 

Mac OS X keeps deleting my /tmp files (mysql.sock)

Post by D P Schreb » Fri, 19 Jan 2007 03:49:53


That was a bogus suggestion, as I thought we covered already. Leave
my.cnf empty.