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