Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MySQL (http://www.go4expert.com/forums/mysql-forum/)
-   -   Reset MySQL "root" Password (http://www.go4expert.com/forums/reset-mysql-root-password-t19349/)

nayanpaul 8Sep2009 18:33

Reset MySQL "root" Password
 
A Best way to reset MySQL user "root" Password.if you have forget it.No worry just follow this simple steps.I hope u will able to do it within 2 minutes.So let's Start Now..
1.-> Open Microsoft Notepad or type in Run Command Promt notepad , so i hope you have open notepad sucessfully ok now follow next steps carefully.
2.-> Now Copy and Paste the following text that enclosed between ********* to ******** [bold Faces] in your Notepad , and save as it Microsoft DOS batch Format (.bat file) i.e reset.bat
i hope you have save this notepad text in .bat format.so reset.bat is your file.
3.->Now move this reset.bat file to MySQL Server Home Directory i.e if you used General MySQL Server ( No Packages) your Home Directory is C:\Program Files\MySQL\MySQL Server 5.x
4.-> If You used WAMPP server Packages your reset.bat file should be placed in C:\wampp\bin\mysql directory
5.->If you used xampp server Package your reset.bat file should be placed in C:\xampp\mysql directory and Double Click when U need to reset MySQL "root" Password.
6.I hope You will take it. For Any Suggestion or Any mistakes please Mail me nayan.paul@yahoo.com
************************************************** ************************

@ECHO OFF
cd/
taskkill /f /im mysqld.exe

ECHO USE `mysql`; >resetroot.sql
ECHO. >>resetroot.sql
ECHO INSERT IGNORE INTO `user` VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', 0, 0, 0, 0); >>resetroot.sql
ECHO REPLACE INTO `user` VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', 0, 0, 0, 0); >>resetroot.sql

bin\mysqld.exe --no-defaults --bind-address=127.0.0.1 --bootstrap --console --skip-grant-tables --skip-innodb --standalone <resetroot.sql >resetroot.err 2>&1
IF ERRORLEVEL 1 GOTO MySQL1
GOTO MySQL2

:MySQL1
TYPE resetroot.err
ECHO.
ECHO Package Designed by nayan.paul@yahoo.com

ECHO Passwords for user "root" Has Been Deleted Sucessfully
ECHO ENJOY Because User "root" Has NO PASSWORD :) :) :)
ECHO But In Security Reason Please Choose a New Password. (: : (:
ECHO Please restart the MySQL server Because This Operation has stop the MySQL Server.
ECHO Thank You For Using This Package.
GOTO MySQL3

:MySQL2
ECHO.
ECHO Package Designed by
nayan.paul@yahoo.com

ECHO Passwords for user "root" Has Been Deleted Sucessfully.
ECHO ENJOY Because User "root" Has NO PASSWORD :) :) :)
ECHO But In Security Reason Please Choose a New Password. (: (: (:
ECHO Please restart the MySQL server Because This Operation has stop the MySQL Server.
ECHO Thank You For Using This Package.
GOTO MySQL3

:MySQL3
DEL resetroot.err
DEL resetroot.sql
ECHO.
PAUSE


************************************************** ************************

shabbir 8Sep2009 18:42

Re: Reset MySQL "root" Password
 
How about Reset MySQL password for Windows Vista

pradeep 8Sep2009 19:39

Re: Reset MySQL "root" Password
 
Cool!


All times are GMT +5.5. The time now is 16:51.