How to Change and Reset MySQL 8 Root Password on Ubuntu 18.04

MySQL database has a root user who is the main user or administrator who can configure and have access to all databases. Very often the case of wanting to change the root password for example due to changing server or system administrator. In the case of a password reset, it’s usually because you forgot the root password. Well, in this tutorial we will discuss about how to change and reset the MySQL 8 password on Ubuntu 18.04.

Change Password

Change the root password here means that we can still log in using the root user, we still know the password, but want to change the password.

Login to mysql with user root.

Change password root.

Login into mysql for test new password .

Reset Password

Reset password here means that we forget or don’t know the root password, so you have to reset or change the password by force.

Stop mysql service.

Run the mysql service with options --skip-grant-tables.

Login to mysql.

Reload grant table.

Change password root.

Reload grant table and exit.

Restart Ubuntu.

Login to mysql with new password .

Mungkin Anda Menyukai

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *