之前在電腦里安裝了MySQL57之后,一直沒用,卻忘記了root密碼,

在網上找了一些資料修改root密碼,卻一直出錯。直到試到這個:

用管理員權限打開CMD

CD C:\Program Files\MySQL\MySQL Server 5.7\bin

net stop mysql57

mysqld --skip-grant-tables

再另外打開一個管理員權限的CMD

CD C:\Program Files\MySQL\MySQL Server 5.7\bin

mysql

mysql> use mysql

mysql> update mysql.user set authentication_string=PASSWORD('yourpassword') where user='root';

mysql> flush privileges;

mysql> quit
Bye

OK,用新密碼登陸即可:

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

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

最新文章

  1. Unity3D 物体跟随鼠标旋转
  2. String 和 byte[]
  3. focuskye 学习及下载
  4. memcached完全剖析--1
  5. juery mobile select下来菜单选项提交form问题
  6. 文件磁盘读写类CArchive类
  7. python socket学习
  8. Java第四周学习日记(绪)
  9. HDU1695-GCD(数论-欧拉函数-容斥)
  10. MySQL1236错误的恢复
  11. 小兴趣:修改Hosts文件,禁止访问指定网页
  12. js 用touch事件实现简单tap
  13. Excel坐标自动在AutoCad绘图_5
  14. 外部javascript
  15. Js 分别取一个数的百位,十位,个位
  16. 服务发现:Zookeeper vs etcd vs Consul 参考自http://dockone.io/article/667
  17. 1.mybatis入门
  18. buffers与cached
  19. Mac OS 基于 VirtualEnv 的安装 tensorflow 1.3.0
  20. linux下c的网络编程---转载

热门文章

  1. linux下mycat读写分离的配置
  2. python 基础之第十二天(re正则,socket模块)
  3. Matrix Recurrence
  4. 搭建Linux的VMware Workstation Pro
  5. C++11: Multi-core Programming – PPL Parallel Aggregation Explained
  6. 5 pyspark学习---Broadcast&Accumulator&sparkConf
  7. fitnesse(gradle构建)安装步骤
  8. Appium + junit 的简单实例
  9. HDU4247【瞎搞】
  10. word2vec改进之Negative Sampling