Mysql – Resetting root password for MySQL problems (Mac OS X Lion)

MySQLosx-lion

I've been trying to reset the root password, and have been following these instructions: [DEAD-LINK]

However, when I use the command:

/usr/local/mysql/bin/mysqld_safe --skip-grant-tables

I receive the following output:

111217 10:00:42 mysqld_safe Logging to '/usr/local/mysql/data/******-********-MacBook-Pro.local.err'.
111217 10:00:42 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
/usr/local/mysql/bin/mysqld_safe: line 107: /usr/local/mysql/data/********-********-MacBook-Pro.local.err: Permission denied
/usr/local/mysql/bin/mysqld_safe: line 144: /usr/local/mysql/data/*******-**********-MacBook-Pro.local.err: Permission denied
111217 10:00:42 mysqld_safe mysqld from pid file /usr/local/mysql/data/*********-********-MacBook-Pro.local.pid ended
/usr/local/mysql/bin/mysqld_safe: line 107: /usr/local/mysql/data/*******-*********-MacBook-Pro.local.err: Permission denied
**********-*********-MacBook-Pro:~ myname$ 

Why would my permission be denied and how can I fix it? (I have checked to see that this is the correct path, and it is). Please help, thank you.

Best Answer

I hope this sounds plausible

You need to shutdown mysql first

The MacBook-Pro.local.err files is probably locked because mysqld is still running.

Once you shutdown mysql, then you can start it back up with --skip-grant-tables

Here ia another possibility:

I normally do not start mysql with mysqld_safe.

I start it as a server (DISCLAIMER: I do not use Mac OSX)

Starting mysqld_safe without it knowing my.cnf will start with whatever mysqld_safe knows of. In Linux, I would start it as

service mysql start --skip-grant-tables

Try starting mysqld_safe with my.cnf as follows:

mysqld_safe --defaults-file=/etc/my.cnf --skip-grant-tables

If /etc is not the location of your my.cnf, locate it and start mysqld_safe as shown, but using the correct path for my.cnf