Pages

Hiển thị các bài đăng có nhãn Database. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Database. Hiển thị tất cả bài đăng

2 thg 3, 2011

Reset password for "root" in MySQL 5.5.9

Following, these steps will help you reset password for root account in MySQL 5.5.9 (not for 5.4 before).

      Step 1: Log on as Administator and Stop mysqld (MySQL service) by use Task Manager

      Step 2: Create a text file, containing
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;
.
Note that you must instead 'MyNewPass' by your new password. UPDATE and FLUSH each on a single line. Assume you save it at C:\mysql-init.txt

      Step 3: cd to mysql\bin and run command: mysqld --init-file=C:\\mysql-init.txt --console . Now, you can open mysql and type mysql -u root -p and type your new password.


Wish you success!