спираме mysql сървиса, след това
mysqld_safe –skip-grant-tables &
mysql –user=root mysql
mysql> update user set Password=PASSWORD(‘newpassword’) where user=’root’;
Query OK, 0 rows affected (0.00 sec)Rows matched: 0 Changed: 0 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit;
Bye