Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been trying to reset the root password, and have been following these instructions: http://www.coolestguyplanet.net/how-to-change-the-mysql-root-password/

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.

share|improve this question
    
Those instructions assume that you are running as root. Use sudo /usr/local/mysql/bin/mysql_safe --skip-grant-tables. You will be prompted for your password when you start. –  slillibri Dec 17 '11 at 23:28
    
possible duplicate of Resetting root password for MySQL problems (Mac OS X Lion) –  RobM Jan 7 '12 at 11:12

1 Answer 1

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

share|improve this answer
    
I shut down the MySQL server first before running the skip grant tables code –  user1072337 Dec 17 '11 at 22:50
    
When I try to type service mysql start --skip-grant-tables into terminal, I get the response, -bash: service: command not found –  user1072337 Dec 17 '11 at 23:22
    
In doing some research...OS X nor MySQL will read/follow the my.cnf config file. Is there another way? There has to be a way, this is driving me insane lol. –  user1072337 Dec 17 '11 at 23:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.