Mysql 忘记密码重置密码

1:停止mysql服务
2:以管理员的身份打开cmd,然后输入mysqld --defaults-file=“C:\Program Files\MySQL\MySQL Server 5.6\my-default.ini” --console --skip-grant-tables

C:\windows\system32>mysqld --defaults-file=“C:\Program Files\MySQL\MySQL Server 5.6\my-default.ini” --console --skip-grant-tables
2018-09-28 13:54:23 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-09-28 13:54:23 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-09-28 13:54:23 0 [Note] mysqld (mysqld 5.6.40) starting as process 8476 …
2018-09-28 13:54:23 8476 [Note] Plugin ‘FEDERATED’ is disabled.
2018-09-28 13:54:23 8476 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-09-28 13:54:23 8476 [Note] InnoDB: The InnoDB memory heap is disabled
2018-09-28 13:54:23 8476 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2018-09-28 13:54:23 8476 [Note] InnoDB: Memory barrier is not used
2018-09-28 13:54:23 8476 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-09-28 13:54:23 8476 [Note] InnoDB: Not using CPU crc32 instructions
2018-09-28 13:54:23 8476 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-09-28 13:54:23 8476 [Note] InnoDB: Completed initialization of buffer pool
2018-09-28 13:54:23 8476 [Note] InnoDB: Highest supported file format is Barracuda.
2018-09-28 13:54:24 8476 [Note] InnoDB: 128 rollback segment(s) are active.
2018-09-28 13:54:24 8476 [Note] InnoDB: Waiting for purge to start
2018-09-28 13:54:24 8476 [Note] InnoDB: 5.6.40 started; log sequence number 55233480
2018-09-28 13:54:24 8476 [Note] Server hostname (bind-address): ‘*’; port: 3306
2018-09-28 13:54:24 8476 [Note] IPv6 is available.
2018-09-28 13:54:24 8476 [Note] - ‘::’ resolves to ‘::’;
2018-09-28 13:54:24 8476 [Note] Server socket created on IP: ‘::’.
2018-09-28 13:54:24 8476 [Note] mysqld: ready for connections.
Version: ‘5.6.40’ socket: ‘’ port: 3306 MySQL Community Server (GPL)
3:然后在重新以管理员的角色打开一个cmd,输入

use mysql;
update user set authentication_string=password(“root”) where user=“root” //string=password(“root”) root 是密码
flush privileges;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值