Update root Password

To update your root password you need to run this script.

Enter to your MariaDB.

mariadb

Press ENTER and choose the database.

use mysql;

Press ENTER

update user set authentication_string=PASSWORD('YOUR_OWN_PASSWORD') where user='root';

Press ENTER to change the root password.

Make sure the output look like this:

Query OK, 1 row affected (0.000 sec)
Rows matched: 1  Changed: 1  Warnings: 0

The password for root is saved on plain text and we need to secure this password by adding the mysql_native_password

update user set plugin='mysql_native_password' where user='root';

Press ENTER

And you will see the update like this:

Query OK, 1 row affected (0.000 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Enter the script below and press ENTER

flush privileges;

Exit from your database and press ENTER

exit;

Now try to login using root.

Register Vultr to use this tutorial and get $100.

Last updated

Was this helpful?