i’ve been trying for hours to install mysql on my g5. i’ve been doing everything vanilla. i keep getting this:
$ mysqld_safe touch: /usr/local/mysql/data/g5bachir.local.err: Permission denied chown: /usr/local/mysql/data/g5bachir.local.err: Permission denied Starting mysqld daemon with databases from /usr/local/mysql/data /usr/local/mysql/bin/mysqld_safe: line 302: /usr/local/mysql/data/g5bachir.local.err: Permission denied rm: /usr/local/mysql/data/g5bachir.local.pid: Permission denied /usr/local/mysql/bin/mysqld_safe: line 308: /usr/local/mysql/data/g5bachir.local.err: Permission denied STOPPING server from pid file /usr/local/mysql/data/g5bachir.local.pid tee: /usr/local/mysql/data/g5bachir.local.err: Permission denied 050130 04:57:25 mysqld ended tee: /usr/local/mysql/data/g5bachir.local.err: Permission denied
even after chowning everything to mysql, chmoding o+w, et cetera
any ideas?
update: I’ve solved it!.
do you know which user the safe daemon is running with? Maybe it’s not ‘mysql’? Anyway, can you just chmod -R 777 * in the data dir (or even the whole mysql dir), then pull back perms after that?
hmm, well it dies differently now. i’ve seen this behvior before. i’m not sure what the circumstances are.
john@g5bachir:~$ sudo chmod -R 777 /usr/local/mysql
john@g5bachir:~$ mysqld_safe
Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/g5bachir.local.pid
050130 17:20:22 mysqld ended
try this:
sudo mysqld_safe
to start it.
mysqld_safe probably changes it’s effective user id, which may be something only root can do.
If that works, you can probably set the file ownership back to their original values and see if it still works. It will be a bit more secure that way.
Hi troy (the first non-acquaintance commenter on my blog :-) )
That doesn’t work either:
john@g5bachir:~$ sudo mysqld_safe
Password:
Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/g5bachir.local.pid
050202 03:01:14 mysqld ended
john@g5bachir:~$ su -
Password:
g5bachir:~ root# /usr/local/mysql/bin/mysqld_safe
Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/g5bachir.local.pid
050202 03:01:41 mysqld ende
here’s some more info. from the error log (and no, i don’t have another mysqld running):
# cat /usr/local/mysql/data/127.0.0.1.err
050205 14:18:37 mysqld started
050205 14:18:37 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
050205 14:18:37 [ERROR] Can’t start server : Bind on unix socket: Permission denied
050205 14:18:37 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
050205 14:18:37 [ERROR] Aborting
050205 14:18:37 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
050205 14:18:37 mysqld ended
It’s a known bug.
And it hasn’t been fixed, no matter what this thread claims.
http://bugs.mysql.com/bug.php?id=7535
Check out this link for my solution
this link :-D
Great. Thats the solution. Spread the word!
I had the same problem. Seems I already had another MySQL process running somehow! After killing it, I was able to run mysqld_safe successfully.
I fixed this problem on my server.
Somehow when I stopped mysqld, the owner of /var/run/mysqld (the location of the pid) was obliterated — the folder was owned by no one. I chown’d it back to mysql and mysqld started up normally. Hope this helps someone.