How to change password for root use in MySQL 8.0
How to change password for root use in MySQL 8.0
Luckily there is an easy to achieve and this tutorial will guide you through the process of recovering or resetting root password in MySQL 8.0 version.
You should use the command line:
$ sudo mysql -u root -p
Enter and don't enter pass
$ use mysql
$ ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
$ exit
# ReLogin MySQL
$ sudo mysql -u root -p
Enter password
In an unfortunate event of forgetting or losing your MySQL root password, you will surely need a way to recover it somehow. What we need to know is that the password is stored in the users table. This means that we need to figure out a way to bypass the MySQL authentication, so we can update the password record.
Luckily there is an easy to achieve and this tutorial will guide you through the process of recovering or resetting root password in MySQL 8.0 version.
As per MySQL documentation there are two ways to reset the root MySQL password. We will review both.
You should use the command line:
$ sudo mysql -u root -p
Enter and don't enter pass
$ use mysql
$ ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
$ exit
# ReLogin MySQL
$ sudo mysql -u root -p
Enter password
Post a Comment