输入 MySQL , 然后回车
Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 3 to server version: 3.23.56
- Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
- MySQL> USE MySQL ;
- Database changed
- MySQL> UPDATE user SET password = password ( 'new-password' ) WHERE User = 'root' ;
- Query OK, 0 rows affected (0.00 sec)
- Rows matched: 2 Changed: 0 Warnings: 0
- MySQL> flush privileges ;
- Query OK, 0 rows affected (0.01 sec)
- MySQL> quit
来源: http://www.bubuko.com/infodetail-2970065.html