Cara reset password phpmyadmin di ubuntu

At first run this command:

sudo mysql

and then you should check which authentication method of your MySQL user accounts use.So run this command

SELECT user,authentication_string,plugin,host FROM mysql.user;

now you can see something like this already :

+------------------+-------------------------------------------+-----------------------+-----------+
| user             | authentication_string                     | plugin                | host      |
+------------------+-------------------------------------------+-----------------------+-----------+
| root             |                                           | auth_socket           | localhost |
| mysql.session    | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost |
| mysql.sys        | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost |
| debian-sys-maint | *CC744277A401A7D25BE1CA89AFF17BF607F876FF | mysql_native_password | localhost |
+------------------+-------------------------------------------+-----------------------+-----------+

in the table that is in the above , you can see that all of your mysql users accounts status & if you have set a password for root account before you see mysql_native_password in plugin column instead auth_socket. All in all for change your root password you should run :

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

Be sure to change password to a strong password of your choosing. Then for reload your server to put your new changes into effect run this;

FLUSH PRIVILEGES;

So again check the authentication methods which has employed by your mysql , by this command:

SELECT user,authentication_string,plugin,host FROM mysql.user;

and now the output is :

+------------------+-------------------------------------------+-----------------------+-----------+
| user             | authentication_string                     | plugin                | host      |
+------------------+-------------------------------------------+-----------------------+-----------+
| root             | *3636DACC8616D997782ADD0839F92C1571D6D78F | mysql_native_password | localhost |
| mysql.session    | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost |
| mysql.sys        | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost |
| debian-sys-maint | *CC744277A401A7D25BE1CA89AFF17BF607F876FF | mysql_native_password | localhost |
+------------------+-------------------------------------------+-----------------------+-----------+

as you can see in the grant table your root account has mysql_native_password . now you can exit MYSQL shell

exit;

That's it.just you should restart mysql by sudo service mysql restart. Now you can login to mysql as a root account with your password easily.

Terkadang ketika menginstal mysql dan phpmyadmin, kita sering lupa password yang baru saja diinput, atau bahkan kita tidak diminta memasukan password root kita sehingga default password akun root nya kosong (password kosong hanya bisa digunakan di server lokal semacam localhost, tetapi tidak bisa digunakan untuk server online), lalu bagaimana cara reset password root mysql phpmyadmin?

Sebelumnya Anda harus ada aplikasi putty untuk meremote langsung ke server yang akan dituju. Jika tidak bisa login http://xxx/phpmyadmin dengan password kosong(default installnya), ikuti langkah langkah berikut ini:

  1. Login SSH (putty) dengan menggunakan akses root
  2. Masuk ke mode mysql dengan mengetik perintah berikut
    $ sudo mysql -u root​
  3. Lalu update password dengan perintah berikut
    $ ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new-password';
  4. Jika Sudah lakukan stop dan start ulang mysql server
    $ sudo service mysql stop
    $ sudo service mysql start
  5. Selesai! Silakan login phpmyadmin dengan akun root dan password yang baru.

Demikian artikel yang kami bahas tentang cara reset password root mysql phpmyadmin kali ini, semoga bermanfaat. Jika ada kesulitan silahkan tanyakan di komentar. Terimakasih:)

Baca juga: Cara Membuat Private Nameserver dengan BIND di Ubuntu/Debian

Resetting or Changing PHPMyAdmin Password On Linux. Sometimes you might have the problem of resetting your phpmyadmin password. Everytime it makes you to feel big to work.  And some tutorials are not nice to read and follow. because they may suggested the final step mainly. Let me elaborate you in detail.

Cara reset password phpmyadmin di ubuntu

Just goto your Terminal. Just do the following steps.

Stop the MySQL server to get `mysqld` access to change your admin password.

sudo service mysql stop

Start mysqld to access the mysql table directly without mysql Server.

sudo mysqld --skip-grant-tables &

Login to MySQL as root without providing password. So, if you forget the Root password, you can reset with it.

mysql -u root mysql

Change KVCODES with your new root password

UPDATE user SET Password=PASSWORD('KVCODES') WHERE User='root'; FLUSH PRIVILEGES; exit;  // Change your password instead of KVCODES

Sometimes it wont work, so lets try two more options.

The first alternative option would be the below command.

UPDATE user SET authentication_string=PASSWORD('KVCODES') WHERE User='root'; FLUSH PRIVILEGES; exit; // Change your password instead of KVCODES

And the second alternative method would be like this

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'KVCODES';

Kill mysqld after changing the password

sudo pkill mysqld

Start mysql  and phpmyadmin

sudo service mysql start

Login to phpmyadmin as root with your new password.