Heim  >  Artikel  >  Datenbank  >  mysql找回root密码的方法

mysql找回root密码的方法

WBOY
WBOYOriginal
2016-06-07 17:51:221314Durchsuche

分享一篇关于大家会常常碰到的问题,就是突然不记得了mysql服务器的root密码了,有的朋友就直接重装系统,这也是办法,但我们提供更方便的找回mysql root密码的方法哦。

1、windows 下;

2、服务管理器wamp5;


二话不说直下正题:

1、打开任务管理器,结束进程 d-nt.exe 如图:

 

2、运行命令窗口

1)、进行php服务管理器安装目录中的bin目录下 (我的为:D:wampmysqlbin) ,

操作为:

(1)、进入D盘 如: d: 回车;

(2)、进入bin目录 如: cd wampmysqlbin; 回车;

(3)、跳过权限检查启动MySQL 如: mysqld-nt --skip-grant-tables; 回车

(4)、此时,看到光标只能一闪一闪的,不能操作时,即为成功了一大步;

 

 

2)、另外再打开一个命令窗口:

操作为:

(1)、进行php服务管理器安装目录中的bin目录下 即:

进入D盘 如: d: 回车;

进入bin目录 如: cd wampmysqlbin; 回车;

(2)、进入use数据表,输入命令 如:use mysql 回车;

(3)、开始设置密码 如: update user set password=password("123456") where user="root"; 回车

(4)、进行所谓的刷新 如:flush privileges; 回车

(5)、退出 如: exit; 回车 ok;


注:(6)、当还没启动时,用绝招(打开任务管理器,结束进程 mysqld-nt.exe 再重新启动; 绝对 ok!)

 

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn