Mysql 找回密码

1,找到安装mysql的位置

      输入cmd:进入mysql bin安装目录

      如:D:\Program Files\MySQL\MySQL Server 5.5\bin>mysqld --skip-grant-tables

      执行如上命令:这个cmd窗口就暂时不动

2.重新打开一个新的命令窗体

     输入cmd进入安装目录bin文件下执行mysql命令

     如:D:\Program Files\MySQL\MySQL Server 5.5\bin>mysql

     输入以下命令:进行修改密码:

    mysql> use mysql
    Database changed
    mysql> update user set password=password("123") where user="root";
    Query OK, 1 row affected (0.05 sec)
    Rows matched: 1  Changed: 1  Warnings: 0

    刷新权限:
   mysql> flush privileges;
    Query OK, 0 rows affected (0.16 sec)

   退出命令窗体

   mysql>  quit;

3.重新进入mysql

D:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -u root -p
Enter password: ***
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.28 MySQL Community Server (GPL)

 

4.备注:

   如果有错,请向在服务中结束mysql ,或者net stop mysql5

 

 

   

转载于:https://www.cnblogs.com/linsu/p/4162013.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值