Cara reset password ROOT mysql di centos

Posted on

Beberapa jam yang lalu server saya bermasalah dan payahnya saya lupa password mysql, akhirnya jalan satu-satunya adalah reset password mysql . dan ini dia caranya :

Stop MySQL:

root#  service mysqld stop


Start MySQL in safe mode:

root#  mysqld_safe –skip-grant-tables &


Log into MySQL as root:

root#  mysql -u root


Reset the password:

mysql>  update mysql.user set password=PASSWORD(“YourNewPassW0RD”) where User=’root’;

mysql>  flush privileges; exit;


Keluar dari MySQL and stop dari Safe Mode:

root#  service mysqld stop


jalankan MySQL in the normal mode:

root#  service mysqld start


Masuk ke MySQL dengan password baru tadi:

root#  mysql -u root -p

Enter password:




Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.