MAC OS X-Reset MySQL Root password
Have you forgotten the root password of MySQL for Mac OS? You can reset your new password by following 4 steps:
1. Stop MySQL server. Usually in ' System Preferences ' > MySQL > ' Stop mysql Server '
2. Open the terminal and enter:
Sudo/usr/local/mysql/bin/mysqld_safe--skip-grant-tables
3. Open another new terminal and enter:
Sudo/usr/local/mysql/bin/mysql-u Root
UPDATE mysql.user SET authentication_string=password (' New password ') WHERE user= ' root ';
FLUSH privileges;
\q
4. Restart MySQL.
* Above method for MySQL V5.7.9, old version of MySQL please use: UPDATE mysql.user SET password=password (' New password ') WHERE user= ' root ';
How to uninstall MySQL
Starting from Yosemite,/etc/hostconfig This file has been removed, so the system after Yosemite can ignore the following command
sudo nano/etc/hostconfig
Here is the terminal execution code that walks you:
- sudo rm-rf/usr/local/mysql
- sudo rm-rf/usr/local/mysql*
- sudo rm-rf/library/startupitems/mysqlcom
- sudo rm-rf/library/preferencepanes/my*
- sudo nano/etc/hostconfig (copy the front part of the carriage return, then delete this line: Mysqlcom=-yes-,control+o enter save, control+x exit the Edit interface)
- sudo rm-rf ~/library/preferencepanes/my*
- sudo rm-rf/library/receipts/mysql*
- sudo rm-rf/library/receipts/mysql*
- sudo rm-rf/var/db/receipts/com.mysql.*
Mac Mysql Reset root password, uninstall