欢迎来到天天文库
浏览记录
ID:38272113
大小:51.14 KB
页数:5页
时间:2019-06-07
《MySQL5.5忘记root密码的解决办法》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、MySql5.5忘记root密码的解决方法操作系统:windows操作系统,xp或win7.1.进入C:ProgramFilesMySQLMySQLServer5.5bin,新建cmd.bat文件,内容为cmd.exe双击cmd.bat,进入目录后停止mysql服务e:mysql5.5bin>netstopmysql注意:看看那任务管理器中是否有mysqld.exe进程,如有,killthemall.2.以不检查权限的方式启动mysqle:mysql5.5bin>mysqld.exe--skip-grant-tables你会看到
2、窗口光标在下一行的第一个位置闪烁,这说明已经启动了,不需要管。3.新建一个命令行窗口同样进入到e:mysql5.5bin目录,启动mysqle:mysql5.5bin>mysql4.修改root密码mysql>usemysqlmysql>updateusersetpassword=PASSWORD('new_password')whereuser='root';mysql>flushprivileges;mysql>quit5.看看那任务管理器中是否有mysqld.exe进程,如有,killthemall.6.重启mysql,就可以用你
3、设置新密码登陆e:mysql5.5bin>netstartmysqle:mysql5.5bin>mysql-uroot-pnew_passwordthat'sall.默认密码是空的情况下修改密码C:xamppmysqlbin>C:xamppmysqlbin>mysql-urootWelcometotheMySQLmonitor.Commandsendwith;org.YourMySQLconnectionidis1378Serverversion:5.5.25aMySQLCommunityServer(GPL)Copyri
4、ght(c)2000,2011,Oracleand/oritsaffiliates.Allrightsreserved.OracleisaregisteredtrademarkofOracleCorporationand/oritsaffiliates.Othernamesmaybetrademarksoftheirrespectiveowners.Type'help;'or'h'forhelp.Type'c'toclearthecurrentinputstatement.mysql>SETPASSWORDFOR'root'@'localh
5、ost'=PASSWORD('root');QueryOK,0rowsaffected(0.00sec)mysql>flushprivileges;刷新权限注意后面的分号(;)QueryOK,0rowsaffected(0.00sec)反馈结果,表示成功mysql>quit;退出登陆Bye反馈结果C:xamppmysqlbin>或MicrosoftWindows[版本5.2.3790](C)版权所有1985-2003MicrosoftCorp.C:DocumentsandSettingsAdministrator>cdC:>cdx
6、amppC:xampp>cdmysqlC:xamppmysql>cdbinC:xamppmysqlbin>MySQL-urootMySQL登陆mysql密码空WelcometotheMySQLmonitor.Commandsendwith;org.YourMySQLconnectionidis1830Serverversion:5.5.25aMySQLCommunityServer(GPL)Copyright(c)2000,2011,Oracleand/oritsaffiliates.Allrightsreserved.Oracl
7、eisaregisteredtrademarkofOracleCorporationand/oritsaffiliates.Othernamesmaybetrademarksoftheirrespectiveowners.Type'help;'or'h'forhelp.Type'c'toclearthecurrentinputstatement.登陆成功mysql>updateusersetpassword=password('root')whereuser='root';设备密码为root注意后面的分号(;)QueryOK,0rowsaf
8、fected(0.00sec)Rowsmatched:2Changed:0Warnings:0反馈结果,表示成功mysql>flushprivileg
此文档下载收益归作者所有