http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
Try the command
FLUSH PRIVILEGES
when you log into the MySQL terminal. If that doesn't work, try the following set of commands while in the MySQL terminal$ mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
Change out NEWPASSWORD with whatever password you want. Should be all set!
If you don't remember the password you set for root and need to reset it, follow these steps:
- Stop the mysqld server, this varies per install (on my MAC: sh-3.2# mysqld stop)
- Run the server in safe mode with privilege bypasssudo mysqld_safe --skip-grant-tables
- In a new window connect to the database, set a new password and flush the permissions & quit:mysql -u rootUPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';FLUSH PRIVILEGES;\q
- Stop the safe mode server and start your regular server back. The new password should work now. Worked like a charm for me :)
On Mac OSx Mavericks (2014) use sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop|start|restart
No comments:
Post a Comment