1. 在係統偏好 中,中止MySQL服務.;2. cd/usr/local/mysql-...../bin sudo ./mysqld_safe--skip-grant-tables3. 登錄MySQL;mysql4. 置空root用戶的密碼; mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION; mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'some_pass' WITH GRANT OPTION; mysql> flush privileges; mysql> quit5. 重新啟動MySQL服務,6. 添加密碼mysql> mysqladmin -u root -p password 123 密碼改為123