Would you like to learn how to configure the MySQL service to force the use of authentication via a password? In this tutorial, we are going to show you how to configure the password authentication to the ROOT user account using the command-line of a computer running Ubuntu Linux.
• Ubuntu 20
• Ubuntu 19
• Ubuntu 18
• MySQL 8.0.21
Equipment list
The following section presents the list of equipment used to create this tutorial.
As an Amazon Associate, I earn from qualifying purchases.
Related tutorial – MySQL
On this page, we offer quick access to a list of tutorials related to MySQL.
Tutorial MySQL – Configure the authentication via Password
Install the MySQL service.
Access the MySQL command-line.
On the authentication prompt, a password is not required.
Verify the authentication plugin and the password configured to the ROOT user account.
Here is the command output:
The MySQL ROOT account has no password configured.
The ROOT account is using the authentication plugin named AUTH_SOCKET.
Configure the ROOT account to use the plugin named MYSQL_NATIVE_PASSWORD.
Configure a password to the ROOT account of the MySQL service.
In our example, the password configured was KAMISAMA123.
Save your configuration and exit.
Try to access the MySQL service using the ROOT account and the new password.
Verify the authentication plugin and the password configured to the ROOT user account.
Here is the command output:
Congratulations! You successfully enabled the MySQL password authentication to the ROOT account.