First You have to Stop mysql server:
service mysqld stop
Now Start mysql server in safe mode with Follwing Options:
mysqld_safe –user=mysql –skip-grant-tables –skip-networking &
Now you have to Login to mysql server without password:
mysql -u root mysql
You will get Mysql Prompt.
mysql> UPDATE user SET Password=PASSWORD('newrootpassword') WHERE User='root';Restart mysql server:
mysql> flush privileges;
mysql> exit
service mysqld restart
Login to MySQL With the New Password:
mysql -uroot -pnewrootpassword
Thanks UnixLab
No comments:
Post a Comment