After struggling for hours with trying to get MySQL running on three different machines, I came across this life-saving forum thread which made me look at the most obvious culprit, file permissions of /tmp.
My bug report to Apple:
BIG PROBLEM - /tmp has wrong permissions
I think the 10.3.7 update is responsible for this. On my G5, before AND after repairing disk permissions:
$ ls -l / |grep tmp
drwx—— 9 john staff 306 5 Feb 16:30 tmp/On a pismo, again before AND after repairing disk permissions:
$ ls -l / |grep tmp
lrwxr-xr-x 1 root admin 11 29 Jan 20:54 tmp -> private/tmp/tmp should of course be rwxrwxrwx
Thanks,
John
But how do you change the permissions on /tmp? if I try chmod it will change permission on private/tmp
Thanks, michele.
It’s funny, I was just struggling with this today on a different machine. It seems that OS X has a certain way of dealing with symlinks to directories, where the link has certain fixed permissions and the directory has its own permissions which effectively become the permissions of the link (I don’t know if this is common with other systems). I couldn’t get /tmp to be writable by group and others, but I could get /private/tmp writable by group and others. And after I did that, everything worked just fine.
It might have something to do with the sticky bit… someone (I can’t remember where I saw this) was commenting on /tmp traditionally having the sticky bit turned on, for increased security.
Believe it or not, I found the solution to this after searching for hours:
Do this:
cd /tmp
sudo chmod 1777 .
As soon as I did that, It works!
yep. also i think this all happened because some 3rd party software broke the /tmp -> /private/tmp symlink. so you can re-create that link if you feel so inclinded. do this right after a reboot, and then reboot right after you do it.
sudo rm -rf /tmpsudo ln -s /private/tmp /tmpyou are my god for posting the linking tip. seriously.
I’m glad you found it helpful.
BTW, to see if your symlink is there, do this
ls -F / | grep tmpIf you see
/tmp -> /private/tmp, then your symlink is just fine. now you just need to make sure that the permissions are correct on /private/tmp. you can do this as mentioned above, withsudo chmod 1777 /private/tmpThanks, removing the tmp dir and applying the sym link worked perfectly
Hmmm….I feel SO close. Having a pretty low-degree of self confidence in the Terminal, I feel I need things VERY MUCH spelled out for me. When I “ls -la”, the “tmp -> /private/tmp” still shows a permission of “lrwxr-xr-x”. I can’t seem to get it to change, therefore I have NO CLUE if this is going to solve my problem!
Okay… a bit more description…I get CLOSE to getting the server running….and then it STOPS on my after a few seconds. I don’t understand that.
Eric-Nentrups-PowerMac:/usr/local/mysql ericnentrup$ Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/Eric-Nentrups-PowerMac.local.pid
050304 12:35:31 mysqld ended
And so as far as I can tell, because it STOPS (for whatever reason) I can’t continue on with my setup.
Thoughts?
Try:
sudo chmod 1777 /private/tmpso i’ve tried everything on here and done two clean installs and i still get:
stephen$ Starting mysqld daemon with databases from /usr/local/mysql/data
bin/mysqld_safe: line 311: /usr/local/mysql/data/.local.err: Permission denied
rm: /usr/local/mysql/data/.local.pid: Permission denied
bin/mysqld_safe: line 317: /usr/local/mysql/data/.local.err: Permission denied
STOPPING server from pid file /usr/local/mysql/data/.local.pid
tee: /usr/local/mysql/data/.local.err: Permission denied
050424 00:16:29 mysqld ended
tee: /usr/local/mysql/data/.local.err: Permission denied
before and after I chmod 1777 the tmp directory, i have:
lrwxr-xr-x 1 root wheel 12 24 Apr 00:03 tmp -> /private/tmp
I’m assuming it should be rwxrwxrwx as described above?
sudo chmod 1777 /private/tmp doesn’t work, and I still have problems…i’ve tried re-symlinking as you described above and still no luck…i’m sure i’m missing something
i don’t know if this is relevant, but it seems like my tmp directory a link to itself so i get:
stephen:/tmp stephen$ ls
cs_cache_lock_501 mcx_compositor tmp
is that normal?
sorry :) 1 more piece of information:
stephen:/ stephen$ ls -F / | grep tmp
tmp@
so i don’t get what was expected:
/tmp -> /private/tmp
sorry, a fourth post, and on a month and a half slept page,
“/usr/local/mysql/data/.local.err: Permission denied”
should read:
“/usr/local/mysql/data/stephen.local.err: Permission denied”
5th post!
okay, so i found what was wrong here
the problem was i was:
“trying to start mysqld as OS user admin. Normally, only root has the power to make the switch to user mysql called for by –user=mysql. Thus, mysqld starts running as user admin, who has no permission to touch data files owned by mysql. Try
sudo bin/mysqld_safe –user=mysql –log ”
sorry to clutter the page
thanks so much. i googled ur page and the solution was EXACTLY what i needed. heh. my colleague was trying to solve the problem for days and gave up! :)
man, none of this stuff helps me with my MySQL problem. I can’t get the thing running at all, i keep getting :
Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/G5.local.pid
050526 20:05:29 mysqld ended
I’ve tried two different packages and 2 or 3 different ways to install/launch with no help.
FUnny thing is, i had it running last night but hosed my users up badly and couldn’t log in so i nuked the install. From that point on, no go. Bummage.
Hiya
I wrestled with this same problem for hours. After following dozens of threads and trying all solutions above to no avail, when I eventually did get it working, I’m not even sure how I did it. For a start, downgrading to PHP 4.0.24 might have helped (restarting after wiping the old version, then again after new install).
I thought I’d paste my last few steps below in the hope that anyone suffering like I was will be able to follow the same steps:
Hope that helps?
I worked on this for at least four hours. Finally, in one last effort I downloaded an earlier version of the MySQL installer, deleted all the old mysql files and folders, and installed the previous version. I still had to chown the directories to mysql, but after that it worked perfectly…
I had the same exact problem as Alan. It all worked last night, but then I couldn’t sign in to my databases in the morning. So I deleted the package, tried to reinstall, but am now having the problem everyone else is.
Remember to try the installation advice on http://www.entropy.ch/software/macosx/mysql/, in the “Database Re-Initialization” section.
I just wanted to thank everyone for posting these helps! This issue was driving me nuts on my Powerbook!
Cheers!
OK. This thread has been helpful but the best resource for solving this glitch (under 10.4.4) is:
http://docs.info.apple.com/article.html?artnum=302977
See the section for ‘Self-Installed MySQL’: although the article is about OS X Server the issue is the same for ) OS 10.4.4.
son of a…
wish i’d found this sooner.
cd /tmp
sudo chmod 1777 .
thanks.
This awesome thread solved my problem, which is that Apache wasn’t starting:
I’m running Mac OS X server 10.4.9 but with Apache 1.3, starting everything from the command line (bypassing the Apple GUI). This worked great until I just installed an Apple upgrade. apachectl start would seem to work, but ps -aux would show no process and apachectl stop would complain about a missing PID file. httpd -t and apachectl configtest showed the system was configured as expected (and no syntax errors).
cd /tmp
sudo chmod 1777 .
followed by an immediate reboot started apache right up. Thanks!