Tentang IT dan Komputer

Teknologi Informasi

07 Menghapus “Forgot” Password root pada mysql

Posted by intrik on April 26, 2007

anda lupa (forgot) password root mysql anda. Hal ini akan mempersulit kehidupdan dan kerja anda.  Berikut ini cara menghapus password root mysql anda.

Stop mysql anda

#>/etc/init.d/mysql stop

Jalankan perintah ini

#> /usr/bin/mysqld_safe –skip-grant-tables &
[1] 6702
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6763]: started

Secara otomatis mysql anda akan jalan dengan metode save mode

Kemudian masuk ke mysql anda

#>mysql –user=root mysql
Enter password:  -> Tekan Enter

mysql> update user set Password=PASSWORD(’MasukkanPasswordBaruAnda‘) WHERE User=’root’;
Query OK, 2 rows affected (0.04 sec)
Rows matched: 2  Changed: 2  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

mysql> exit
Bye

Restart mysql anda :

#>/etc/init.d/mysql stop

#>etc/init.d/mysql start

Sekarang coba masuk ke mysql

#>mysql -u root -p

Enter password: ->  Gunakan password baru anda

Sukses…  Semoga ilmu ini bermanfaat.

* Sudah saya coba di debian sarge MYsql : 4.0.24_Debian-10sarge2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: