网站地图 | TAG标签 | RSS订阅 | 【加入收藏,方便下次访问提供有关域名,主机,邮局,服务器,云主机等的相关知识和使用帮助!
热门搜索: 流程 MSSQL 数据库 域名 转入 CN IIS 密码
你现在的位置:网站首页 / 服务器 / 正文内容

MySql5.5忘记root密码的解决方法
时间:2014-9-26 16:2:22 | 作者 : 925help | 分类 : 服务器 | 浏览: 次 | 已有 0 人对本文发表了看法

操作系统:windows操作系统,2008或win7.

C:\Users\Administrator>cd C:\Program Files\MySQL\MySQL Server 5.5\bin

C:\Program Files\MySQL\MySQL Server 5.5\bin>net stop mysql

MySQL 服务正在停止.

MySQL 服务已成功停止。


C:\Program Files\MySQL\MySQL Server 5.5\bin>mysqld --skip-grant-tables

你会看到窗口光标在下一行的第一个位置闪烁,这说明已经启动了,不需要管。


新建一个命令行窗口同样进入到e:\mysql5.5\bin目录,启动mysql

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.5.36 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, 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> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| test               |

+--------------------+

4 rows in set (0.00 sec)

mysql> use mysql;

Database changed

mysql> update user set password=PASSWORD('oracle') where user='root';

Query OK, 2 rows affected (0.00 sec)

Rows matched: 2  Changed: 2  Warnings: 0

mysql> flush privileges;

Query OK, 0 rows affected (0.01 sec)

mysql> quit

Bye
看看那任务管理器中是否有mysqld.exe进程,如有,kill .


C:\Program Files\MySQL\MySQL Server 5.5\bin>net start mysql

MySQL 服务正在启动 .

MySQL 服务已经启动成功。

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -uroot -poracle

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.5.36 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, 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>


本文系作者辛苦写作所得,转载请留下版权链接:本文转载自七彩科技(www.925.top) 帮助系统(http://www.925.cc)感激不尽!

发表评论:

必填,人过留名 雁过留声

选填,填了我们绝对保密

选填,欢迎站长留下链接互访

必填,不填不让过哦,嘻嘻。

记住我,下次回复时不用重新输入个人信息

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

无觅相关文章插件,快速提升流量
Copyright © 2005-2013 925.cc. 七彩科技 客户服务中心 浙ICP备10050069号-1