windows修改mysql数据库密码

标签: linux

打开my.ini文件,填写skip-grant-tables,免密登录

输入mysql -u root -p密码不用填写,直接回车即可登陆 

mysql>  use  mysql;

Database changed

mysql>select    host,user from user;                           //查询USER  表中主机ip ;

mysql>delete from user where  host=’localhost’;       //必须进行这一步删掉已前不能登录的帐户。

mysql>flush  privileges;

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@’localhost’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;                                                        //重新授权帐户

mysql>flush  privileges;

 重启mysql服务用新密码登录就可以了

 

版权声明:本文为qq_14934711原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_14934711/article/details/105249159