方法一: 在my.ini的[mysqld]字段加入:skip-grant-tables重启mysql服务,这时的mysql不需要密码即可登录数据库 然后进入mysqlmysql>use mysql; mysql>更新 user set password=password('新密码') WHERE User='root';mysql>flush privileges; 运行之后最后去掉my.ini中的skip-grant-tables,重启mysqld即可. 方法二: 不使用修改my.in…
B.5.3.2 How to Reset the Root Password If you have never assigned a root password for MySQL, the server does not require a password at all for connecting as root. However, this is insecure. For instructions on assigning passwords, see Section 2.18.4,…