惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

博客园 - Hoooooo

华为交换机系统视图状态system-view超时设置 access trunk hybird untagged和tagged区别 WIN系统命令行添加防火墙配置 yum 安装包时解决依赖关系 Shell脚本--磁盘空间有超过80%时发信息 dos修改字符串排序,可用于修改文件名 linux系统调优用命令 centos7安装配置vnc和远程桌面,WIN10 mstsc远程linux gnome桌面 在linux系统中curlftpfs自动挂载ftp 文件抽取 win10 ie ActiveX 对应注册表编号 AUTUCAD2017 key 五种开源协议(BSD,Apache,GPL,LGPL,MIT) mysql中字符查询与替换 vim 编辑不显示以#或其它开始的行 Redhat 7及Centos 7系统网卡启动 mysql ROOT管理员密码修改 awk字符意义 redhat 7安装oracle 11gr2
mysql忘记root密码解决办法
Hoooooo · 2018-03-12 · via 博客园 - Hoooooo

首先登录MySQL。 
格式:mysql> set password for 用户名@localhost = password('新密码'); 
例子:mysql> set password for root@localhost = password('123'); 

方法2:用mysqladmin 
格式:mysqladmin -u用户名 -p旧密码 password 新密码 
例子:mysqladmin -uroot -p123456 password 123 

方法3:用UPDATE直接编辑user表 
首先登录MySQL。 
mysql> use mysql; 
mysql> update user set password=password('123') where user='root' and host='localhost'; 
mysql> flush privileges; 
二、无法登录的修改方式,限于有权限修改mysql安装文件(此方法适用于linux
方法4:在忘记root密码的时候,可以这样 
以windows为例: 
1.进入mysql安装目录,打开my.ini文件

2.找到[mysqld]配置行(注意,不是[mysql]),在其下一行输入:skip-grant-tables(或者:--skip-grant-tables,两者区别是有时两个横线会导致服务无法重启需要测试应当添加否。)

3.cmd命令:services.msc,找到mysql服务并重启(使修改的配置文件生效

4.mysql命令行:use mysql(进入系统配置库)

5.mysql命令行:update user set password=password("123") where user="root";(别忘了最后加分号,分号意味着命令的结束) 

6.mysql命令行:flush privileges;(刷新缓存,更新数据库读取的密码别忘了最后加分号,分号意味着命令的结束

7.退出mysql,或重启服务,密码设置成功。