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 Answers2

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.

drAlberT
  • 10,949
  • 7
  • 39
  • 52
0

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

sudo /usr/local/mysql/bin/mysqld_safe5 --skip-grant-tables
Peter Mortensen
  • 2,318
  • 5
  • 23
  • 24