mysql 丢失root密码补救办法
来源:互联网 发布:淘宝网是谁创建的 编辑:程序博客网 时间:2024/04/26 01:59
前几天把root密码忘了,于是在网上转了半天,也没有找到一个完整无错的答案。于是经过几十次的尝试后,终于搞定了。也算对得起自己了。
这里把自己的详细设置方法告诉和我一样的菜鸟,希望对你们有点帮助,同时自己也做个备份。
我的mysql为MySQL - 5.0.23:
1、在开始菜单“运行”栏里输入“CMD”,进入到了命令行下
C:/Documents and Settings/millken>
C:/Documents and Settings/millken>.Net stop mysql
C:/Documents and Settings/millken>mysqld-nt --skip-grant-tables
C:/Documents and Settings/millken>
2、新开一个CMD窗口:
*************************************************************************
Microsoft Windows [版本 5.2.3790]
(C) 版权所有 1985-2003 Microsoft Corp.
C:/Documents and Settings/millken>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 18 to server version: 5.0.23-community-nt
Type 'help;' or '/h' for help. Type '/c' to clear the buffer.
mysql> use mysql
Database changed
mysql> update user set password=password("root") where host="localhost" and user="root";
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> set password for "root"@"localhost"=old_password("root");
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables
option so it cannot execute this statement
mysql> exit;
Bye
C:/Documents and Settings/millken>d:
D:/>mysqladmin -u root shutdown
D:/>.Net start mysql
MySQL 服务已经启动成功。
D:/>cd www
D:/WWW>cd mysql
D:/WWW/MYSQL>cd bin
D:/WWW/MYSQL/bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 35 to server version: 5.0.23-community-nt
Type 'help;' or '/h' for help. Type '/c' to clear the buffer.
mysql> set password for 'root'@'localhost'=old_password("root");
Query OK, 0 rows affected (0.00 sec)
mysql>
至此就大功告成了,注意一点的是因为5.0.1版Mysql的password算法和3.23.44的算法不一样了,所以要运行最后一句,不然Phpmyadmin下会进不了。
该文章转载自网络大本营:http://www.xrss.cn/Info/10790.Html
- mysql 丢失root密码补救办法
- MySql Root 密码忘记补救办法
- MySQL数据库中丢失root密码后应当如何补救
- mysql忘记了root密码的补救
- mysql root密码丢失
- mysql root密码丢失
- mysql root密码丢失
- windows下忘记mysql密码的补救办法
- mysql root密码丢失怎么办?
- Mysql root 密码丢失解决方法
- mysql root密码丢失怎么办?
- mysql root密码丢失怎么办?
- solaris系统root口令遗忘或丢失后的补救办法
- Mysql root密码丢失,重置密码
- mysql找回丢失的root密码
- linux下mysql root密码丢失
- windows下mysql root密码丢失怎么办?
- mysql的root密码丢失解决方案
- PHP版UTF-8文件BOM自动检测移除程序
- WML902212232121
- Excel控件的相关属性
- ASP.NET项目中bin,app_code,app_data 等文件夹的作用
- 硬件工程师基础知识
- mysql 丢失root密码补救办法
- 一个计算机高手的成长
- 艰苦的岁月!(一位销售工程师的工作经历)
- 小议“易语言.飞扬”的程序执行效率
- 基础知识,DSP芯片介绍
- 网关服务器之拼包和安全
- MIPS体系下的汇编
- FPGA 入门
- asp.net 一些知识点