1

I just installed MySQL 5 on Mac OS X Snow Leopard (10.6.1), set a password and forgot it. I tried to follow this tutorial: http://blog.innovativethought.net/2007/05/17/resetting-your-forgotten-mysql-password/ but when I do:

/usr/local/mysql/bin/mysqld_safe --ignore-grant-table 

it says:

touch:
/usr/local/mysql/data/unknown-00-24-8d-0d-d4-cf.lan.err:
Permission denied chown:
/usr/local/mysql/data/unknown-00-24-8d-0d-d4-cf.lan.err:
Permission denied Starting mysqld
daemon with databases from
/usr/local/mysql/data
/usr/local/mysql/bin/mysqld_safe: line
380:
/usr/local/mysql/data/unknown-00-24-8d-0d-d4-cf.lan.err:
Permission denied rm:
/usr/local/mysql/data/unknown-00-24-8d-0d-d4-cf.lan.pid:
Permission denied
/usr/local/mysql/bin/mysqld_safe: line
388:
/usr/local/mysql/data/unknown-00-24-8d-0d-d4-cf.lan.err:
Permission denied STOPPING server from
pid file
/usr/local/mysql/data/unknown-00-24-8d-0d-d4-cf.lan.pid
tee:
/usr/local/mysql/data/unknown-00-24-8d-0d-d4-cf.lan.err:
Permission denied 090920 16:14:34
mysqld ended tee:
/usr/local/mysql/data/unknown-00-24-8d-0d-d4-cf.lan.err:
Permission denied

and when I do (using sudo):

sudo /usr/local/mysql/bin/mysqld_safe --ignore-grant-table 

it says:

Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/unknown-00-24-8d-0d-d4-cf.lan.pid
090920 16:15:36 mysqld ended

Why the heck does it stop? Can someone explain it?

Thanks in advance.

Oh,

  • I'm NOT using Mac OS X Server.
  • I've set the password in phpMyAdmin.

2 Answers 2

1

Stop the server before restarting it in safemode.

sudo kill -9 $(cat /usr/local/mysql/data/unknown-00-24-8d-0d-d4-cf.lan.pid) 

Then follow (as root, or with sudo) the instructions.

3
  • 2
    Don't kill -9 unless all else fails. Commented Sep 20, 2009 at 19:19
  • I agree, it was the short way :P Commented Sep 21, 2009 at 7:21
  • 2
    This won't work - launchd will start a new process as soon as it's killed. You need to use launchctl to stop the process and then start your own. Commented Nov 9, 2009 at 21:51
0

I just encountered the same problem and solved it. With MySQL 5, do

sudo /usr/local/mysql/bin/mysqld_safe5 --skip-grant-tables 

You must log in to answer this question.