Ext.: http://www.cnblogs.com/lihuanqing/p/5623872.html
After the installation of MySQL, the system gave a default password, and then accidentally shut down, miserable password is not.
1. Shut down MySQL server sudo/usr/local/mysql/support-files/mysql.server stop can also have a MySQL in System preferences.
This is not required if the service is not started.
2. Cd/usr/local/mysql/bin into the catalogue
3. sudo su get permission
4./mysqld_safe--skip-grant-tables & Restart Server
5, re-open a terminal,
6, Configuration Short command: Alias Mysql=/usr/local/mysql/bin/mysql
7. Input MySQL into MySQL command mode
8. Use MySQL to enter MySQL database
9, flush privileges; probably is to get permission, or he won't let you change.
10. Set password for ' root ' @ ' localhost ' =password (' new password ');
Reset password after MySQL forgot password (Mac)