Would you like to learn how to configure the MariaDB service to force the use of authentication via 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
• MariaDB 10.3

Tutorial MariaDB – Configure the authentication via Password

Install the MariaDB service.

Copy to Clipboard

Access the MariaDB command-line.

Copy to Clipboard

On the authentication prompt, a password is not required.

Copy to Clipboard

Verify the authentication plugin and the password configured to the ROOT user account.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

The MariaDB ROOT account has no password configured.

The ROOT account is using the authentication plugin named UNIX_SOCKET.

Configure a password to the ROOT account of the MariaDB service.

Copy to Clipboard

In our example, the password configured was KAMISAMA123.

Configure the ROOT account to use the plugin named MYSQL_NATIVE_PASSWORD.

Copy to Clipboard

Save your configuration and exit.

Copy to Clipboard

Try to access the MariaDB service using the ROOT account and the new password.

Copy to Clipboard

Verify the authentication plugin and the password configured to the ROOT user account.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Congratulations! You successfully enabled the MariaDB password authentication to the ROOT account.