Reset password mysql di Ubuntu 10.10

January 19, 2011 at 11:45 pm (Linux) (, , )

Ya …ya…ya. saya emang orangnya pelupa bin kadang loss connection. hahahhahahahha *bangga sama diri sendiri* Bego!!!.

Ntah, saya juga lupa ini mysql-nya saya apakan yah? tiba-tiba request phpmyadmin itu not found. Padahal pertama kali install apache, php dan mysql-nya itu semua berjalan normal termasuk phpmyadmin-nya dapat sy akses dengan baik. Tetapi…oh tetapi pas masuk pada pembelajaran database ….eeeh request phpmyadmin error. ckckckck payah!!. Dan mau connect ke mysql-nya…tetooooot!! sy lupa password hahahahahahhah!! payah kuadrat!!

walhasil, selama kuliah tadi saya hanya sibuk bergeriliya di oom google. hahahahhahah!!.

oh ok, langkah pertama yang dilakukan untuk reset password adalah mematikan service mysql-nya :


root@Nhie:~# /etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql
mysql stop/waiting

selanjutnya restart mysqld daemon-nya dengan mengeetikan command :

root@Nhie:~# mysqld_safe --skip-grant-tables &

Hasilnya :


[1] 4715
root@Nhie:~# 110119 23:49:49 mysqld_safe Logging to syslog.
110119 23:49:49 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql


selanjutnya masuk ke mysql-nya

root@Nhie:~# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.49-1ubuntu8.1 (Ubuntu)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

setehal berhasil masuk ubahlah password dari mysql dengan menggunakan command :

mysql> update user set password=password('passwordYgDiinginkan') where user='root';

hasilnya :

Query OK, 3 rows affected (0.08 sec)
Rows matched: 3 Changed: 3 Warnings: 0

sampai disini password mysql telah berhasil direset. Jangan lupa untuk menyimpan selamanya konfigurasi yang telah kita ubah dengan mengetikkan command :

mysql> flush privileges;

Hasilnya :

Query OK, 0 rows affected (0.00 sec)
mysq>

Untuk mengeceknya, silahkan keluar dari mysql promt kemudian masuk lagi dengan command
#mysql -u root -p masukkan password yang baru.

semoga setelah ini saya tidak lupa lagi passwod mysql-ku!! :D.

selamat mencoba, semoga bermanfaat. ๐Ÿ™‚

6 Comments

  1. Fikri said,

    mbak saya tanya,
    kok saya tidak bisa buka root pada ubuntu 10.10 ya?

    kemudian, saya juga tidak bisa mencopy file ke direktori usr/lib/xorg/modules/drivers

    mohon jawabannya, maaf saya pengguna linux baru, masih belajar,, terimakasih

    • Nhie said,

      buka root gimana maksudnya??
      kalau kemungkinan ndak bisa copy itu ..karena ada bukan super admin.

  2. oioi said,

    oi nhie … itu yang tampilan terminal di kasih beda dons, biar jelas ^^
    trims b4 atas ilmunya ๐Ÿ˜€

  3. Fadjar said,

    Terima kasih tutorialnya mas, sangat bermanfaat sekali ijin copas ya mas…gbu ๐Ÿ™‚

    • Nhie said,

      sy bukan mas mas!! sy berjenis kelamin wanita!!

      terima kasih kembali telah membaca artikel sy. silahkan di copas :d. semoga bermanfaat.

  4. Estiko said,

    Sayangnya untuk server masih enak menggunakan CentOS. Tapi tutorial yang menarik. Bisa diaplikasikan kalau mainan localhost ubuntu lagi.

Leave a reply to oioi Cancel reply