5kits zhao

reset mysql root password windows

1- stop mysql database from the services

2- save below code in this file mysql-init.txt in mysql directory under BIN

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;
3-
C:\mysql\bin\mysql --init-file=C:\\mysql-init.txt

make sure the directory is mysql directory, may be the above directroy is not correct ,

Reference

http://dev.mysql.com/doc/refman/4.1/en/resetting-permissions.html

One Response to “reset mysql root password windows”

  1. ayad Says:

    great post

Leave a Reply