3

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.

0xC0000022L
  • 1,456
  • 2
  • 20
  • 41
user1072337
  • 31
  • 1
  • 2
  • 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)](http://serverfault.com/questions/342069/resetting-root-password-for-mysql-problems-mac-os-x-lion) – Rob Moir Jan 07 '12 at 11:12

1 Answers1

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

RolandoMySQLDBA
  • 16,364
  • 3
  • 47
  • 80
  • 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