Trang

2 thg 2, 2010

Reset the Root Password of MySQL Server

Create a text file mysql-init.txt and place the following command within it on a single line: 
SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(‘MyNewPassword’);

Stop the MySQL server

Windows:
mysqld-nt.exe –defaults-file=....\my.ini –init-file=....\mysql-init.txt

Linux:
mysqld_safe –init-file=~/mysql-init.txt

The contents of the mysql-init.txt are executed at server startup, changing the root password. After the server has started successfully you should delete.

Stop the MySQL server, then restart it in normal mode again

Không có nhận xét nào:

Đăng nhận xét