Whilst launching MariaDB via Docker using MYSQL_ALLOW_EMPTY_PASSWORD
I was prompted to run /usr/bin/mysql_secure_installation
. This makes sense but (like others) I prefer configuring things non-interactively so started looking into the SQL commands this script runs. One of the comments to this article includes the following SQL:
UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE User = 'root';
Which in turn led me to find MariaDB advises using ed25519
instead of mysql_native_password
.
So I added the following to my .cnf
which is provided to the Docker container and restarted the container.
[mariadb]
plugin_load_add=auth_ed25519
Then I connected with the mysql
client (from apt install mariadb-client
) and executed:
MariaDB [(none)]> ALTER USER root IDENTIFIED VIA ed25519 USING PASSWORD('secret');
MariaDB [(none)]> \q
Then I attempted to reconnect and receive the following error:
$ mysql --protocol=tcp --user=root -psecret
ERROR 2059 (HY000): Authentication plugin 'client_ed25519' cannot be loaded: /usr/lib/x86_64-linux-gnu/mariadb18/plugin/client_ed25519.so: cannot open shared object file: No such file or directory
$ mysql --version
mysql Ver 15.1 Distrib 10.1.43-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Why am I receiving that error and how I can enable ed25519 authentication with the MariaDB client?