1

Possible Duplicate:
reseting mysql root password

I am having an issue on OS X 10.7.5 as I used to use MAMP but for .htaccess issues I am now using my own compiled local server from a long time ago, the problem is i forgot the root password for mysql.

I have tried updating the password through terminal using mysql -u root, but I get this error message -> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

2 Answers2

3

Try to find mysql_secure_install and run it. This script will allow you to reset root password among all other things.

Possible paths is

/usr/local/mysql/bin/mysql_secure_installation

Hope this helps!

alan978
  • 219
  • 1
  • 1
  • If this script has already been run once, then it will prompt you for the current password with the OP doesn't know. – txyoji Sep 16 '15 at 14:10
1

mysql -u root attempts to login as the root user with no password (which won't work if a password is set, as one would hope). To login, you either need to specify the -p flag and provide the current password; or else see Resetting the Root Password: Unix Systems.

eggyal
  • 392
  • 4
  • 16
  • Ok, to fix the issue I just did a clean install of mysql as I had no databases that I needed. –  Nov 20 '12 at 12:00