mysql 忘記密碼

1. 先停掉 MySQL
2.mysqld_safe –skip-grant-tables&
3.update mysql.user set password=PASSWORD('1234') where user='root';
4.flush privileges;
5.quit
6.MySQL 重新啟動