Mereset Password Mysql user ROOT

Written by admin on November 25th, 2008. Posted in linux

Wahh…. website dan forum ku tidak bisa di buka, karena password mysqlnya baru saja aku ganti, tapi kenapa proses menganti passwordnya salah yah ? , kok malah password baru tidak bisa masuk. nih perintah yang aku masukkan ketika mengganti password mysql nya

[root@istp johan]# mysqladmin password  passwordbaru -u root -p
Enter password: password

nah setelah itu gw coba masuk:

[root@istp johan]# mysql
ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: YES)

waduh.. gawat… gimana nieh… ????

nah, jangan panikkk dulu, ikuti cara dibawah ini untuk mereset password nya :

1. /etc/rc.d/init.d/mysql stop ( atau matikan dulu deamon mysql nya )
2. [root@istp johan]# mysqld_safe --skip-grant-tables
3.[root@istp johan]#
mysql --user=root mysql

pasti masuk…

—————————————————

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 31
Server version: 5.0.51a Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>
——————————————————

4.  mysql>update user set Password=PASSWORD('YourNewRootPassword');
5. mysql>
flush privileges;
6. mysql>
exit;
7. Kill semua proces mysql :

root     17187 0.0  0.2   4748  1144 pts/1    S    11:20   0:00 /bin/sh /usr/bin/mysqld_safe –datadir=/var/lib/mysql –socke
mysql    17249 1.0  3.7 136772 17012 pts/1    Sl   11:20   0:00 /usr/libexec/mysqld –basedir=/usr –datadir=/var/lib/mysql -

8. kill -9 17187

9. kill -9 17249

Lalu startkan kembali mysql anda.

10. /etc/rc.d/init.d/mysqld start

Share

Tags: , ,

Trackback from your site.

Leave a comment