MySQL忘记密码解决
1.设置管理员root密码为123
开启MySQL服务后
PS C:\WINDOWS\system32> mysqladmin -uroot -p password "123"
Enter password:
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
#直接回车,忽略上述提示
再次登录不输入密码,出现一下结果。
PS C:\WINDOWS\system32> mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
2.更改密码
PS C:\WINDOWS\system32>mysqladmin -uroot -p"123" password "456" #修改mysql密码,因为已经有密码了,所以必须输入原密码才能设置新密码
3.忘记密码
3.1关闭MySQL服务器
PS C:\WINDOWS\system32> net stop mysql
MySQL 服务正在停止.
MySQL 服务已成功停止。
3.2跳过授权表
PS C:\WINDOWS\system32> mysqld --skip-grant-tables
3.3再次登录时无需输入密码
PS C:\WINDOWS\system32> mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.27 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, 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.
3.4更改密码为'abc'
mysql> update mysql.user set authentication_string =password('abc') where User='root';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
3.5刷新权限后退出
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
3.6关闭mysql进程
PS C:\WINDOWS\system32> tasklist |findstr mysql
mysqld.exe 11452 Services 0 173,284 K
PS C:\WINDOWS\system32> taskkill /F /PID 11452
成功: 已终止 PID 为 11452 的进程。
3.7再次开启服务,使用新密码登录
PS C:\WINDOWS\system32> net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
PS C:\WINDOWS\system32> mysql -uroot -p
Enter password: ***
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.27 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, 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>
MySQL忘记密码解决的更多相关文章
- 十五、mac 中登陆mysql忘记密码解决办法
mac 中登陆mysql忘记密码解决办法 1.打开终端,输入命令:cd /usr/local/mysql/bin 2.mysql -uroot -p,用这条命令登陆时报错信息: 报错:Enter pa ...
- mysql忘记密码解决的办法
[很管用]忘记mysql root密码解决办法 1.编辑MySQL配置文件: 首先停止mysql服务, 然后开始编辑mysql配置文件:vi /etc/my.cnf在[mysqld]配置段添加如下一行 ...
- MySQL忘记密码解决办法
一.windows下mysql忘记root密码的解决方法 详细出处参考:http://www.jb51.net/article/21984.htm 1,停止MYSQL服务,CMD打开DOS窗口,输入 ...
- C#工具:MySQL忘记密码解决方法
1.进入管理员控制台停止mysql服务:net stop mysql; 2.进入mysql的安装路径,如我的安装路径为C:\Program Files\MySQL\MySQL Server 5.5,打 ...
- mac 中登陆mysql忘记密码解决办法
1.打开终端,输入命令:cd /usr/local/mysql/bin 2.mysql -uroot -p,用这条命令登陆时报错信息: 报错:Enter password: ERROR 1045 (2 ...
- mysql忘记密码解决方法
在windows下:打开命令行窗口,停止mysql服务: net stop mysql 启动mysql,执行: mysqld -nt --skip-grant-tables 另外打开一个命令行窗口,执 ...
- MySQL 忘记密码解决办法
第一步: 关闭MySQL服务. 第二步: 打开DOS窗口,在里面输入安装MqSQL的目录本机为:C:\Program Files\MySQL\MySQL Server 5.6\bin 第三步: 在命 ...
- mac中登陆mysql忘记密码解决办法
1.打开终端,输入命令:cd /usr/local/mysql/bin 2.mysql -uroot -p,用这条命令登陆时报错信息: 报错:Enter password: ERROR 1045 (2 ...
- mac mysql忘记密码解决办法
http://www.jb51.net/article/87580.htm http://blog.csdn.net/soft2buy/article/details/50223373
随机推荐
- CSS 交集选择器和并集选择器
交集选择器是and 也就是要同时满足 且只能交2个只能交2个只能交2个,第一个是标记,第二个是class或者id,之间不可以有空格 eg: span.small-height 并集选择器是or,也就 ...
- Kafka 最新版配置
当前基于kafaka最新版 kafka_2.12-2.2.1.tgz 进行配置 . 官网地址:http://kafka.apache.org/intro kafka的一些基础知识 参考:http:// ...
- IDEA 同时打开多个项目
打开IDEA Settings-->System Settings-->Open project in new wodow
- ngx.shared.DICT.get 详解
ngx.shared.DICT.get 原文: ngx.shared.DICT.get syntax: value, flags = ngx.shared.DICT:get(key) context: ...
- 近似最近邻算法-annoy解析
转自https://www.cnblogs.com/futurehau/p/6524396.html Annoy是高维空间求近似最近邻的一个开源库. Annoy构建一棵二叉树,查询时间为O(logn) ...
- VVDocumenter-Xcode
从Xcode 5开始,苹果要求加入UUID证书从而保证插件的稳定性.因此Xcode版本更新之后需要在VVDocumenter-Xcode的Info.plist文件中添加Xcode的UUID. 步骤 ...
- Java 13新特性
switch表达式 switch表达式是Java 12开始就提供的预览特性,到了Java 13仍然没有被转正.此特性可以把switch的执行结果组合到复合表达式中进行运算. import java.t ...
- Ionic 的安装运行
1.学习前准备工作 1.必须得安装 nodejs (建议安装最新的稳定版本) 2.必须有 Angular 基础:https://www.loaderman.com/goods-1047.html 2. ...
- ISO/IEC 9899:2011 条款6.2.7——兼容类型与组合类型
6.2.7 兼容类型与组合类型 1.两个类型具有兼容类型,如果它们的类型是相同的.用于判定两个类型是否兼容的其它规则在6.7.2关于类型说明符中,6.7.3关于类型说明符中,6.7.6关于声明符中描述 ...
- ehcache的heap、off-heap、desk浅谈
ehcache的heap.off-heap.desk浅谈 答: 从读取速度上比较:heap > off-heap > disk heap堆内内存: heap表示使用堆内内存,heap( ...