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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
爱范儿
爱范儿
博客园 - 聂微东
美团技术团队
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
有赞技术团队
有赞技术团队
云风的 BLOG
云风的 BLOG
罗磊的独立博客
V
Visual Studio Blog
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
V
V2EX
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

博客园 - ShaDowiCool

Italy Sends Soldiers to Naples 那不勒斯 to Fight Organized Crime Sarah Palin, Governor of Alaska, Is McCain's Surprise Choice 测试流程-转载 黑盒测试外包的工作初见 个人面试经历总结 take the bull by the horns blow one's own horn like a house on fire bring down the house or bring the house down burn a hole in one's pocket & burned hook, line and sinker lock, stock and barrel 测试心得(国内软件产品的需求不明确) 黄金的18K和24K是什么意思 freeBSD时区设置与时间设置 freeBSD与linux下mysql命令 测中策---我的Web自动化测试思路 测试经验总结 我的测试心得 Linux误删数据文件的处理方法
Mysql忘记root密码的解决办法
ShaDowiCool · 2008-06-04 · via 博客园 - ShaDowiCool

mysql忘记root密码如何处理

在windows下:
打开命令行窗口,停止mysql服务(或者在任务管理器里结束掉mysqld-nt.exe进程):        Net stop mysql
启动mysql,一般到mysql的安装路径,找到 mysqld-nt.exe
执行:mysqld-nt --skip-grant-tables
另外打开一个命令行窗口,执行mysql
 use mysql
 update user set password=password("123456") where user="root";
 flush privileges;
 exit
用Ctrl+Alt+Del,找到mysqld-nt的进程杀掉它,在重新启动mysql-nt服务,就可以用新密码登录了.

在linux下:
如果 MySQL 正在运行,首先杀之: killall -TERM mysqld。 
启动 MySQL :bin/safe_mysqld --skip-grant-tables & 
就可以不需要密码就进入 MySQL 了。 
然后就是 
 use mysql
 update user set password=password("new_pass" where user="root";
 flush privileges;
重新杀 MySQL ,用正常方法启动 MySQL.
(问题解决,昨天被同事抢了我的show!)