新装的mysql在登录时需要注意: For example, if you run the server using the mysql login account, you should log in as mysql before using the instructions. Alternatively, you can log in as root, but in
首先把MySQL停止,然后以命令行参数启动mysql:# /usr/bin/mysqld_safe --skip-grant-tables &,然后就可以以空密码进入MySQL,之后的操作就是一般的正常修改密码的操作了。 use mysql; update user set password=password('123456') where user='root'; flush privile