Description\n-----------\n\nMySQL has used SHA-1 based authentication since version 4.1. The authentication plugin is called mysql_native_password. Over the years as computers became faster, new attacks on SHA-1 were being developed. Nowadays SHA-1 is no longer considered as secure as it was in 2001. That's why the ed25519 authentication plugin was created.\n\nThe ed25519 authentication plugin uses Elliptic Curve Digital Signature Algorithm (ECDSA) to securely store users' passwords and to authenticate users. The ed25519 algorithm is the same one that is used by OpenSSH. It is based on the elliptic curve and code created by Daniel J. Bernstein.\n\nInstalling the Plugin\n\nAlthough the plugin's shared library is distributed by default with MariaDB, with a file name of auth_ed25519.so (Unix) or auth_ed25519.dll (Windows), the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB.\n\nThe first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME or INSTALL PLUGIN:\n\n``sql\nINSTALL SONAME 'auth_ed25519';\n`\n\nThe second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the --plugin-load or the --plugin-load-add options. This can be specified as a command-line argument to mariadbd or it can be specified in a relevant server option group in an option file:\n\n`ini\n[mariadb]\n...\nplugin_load_add = auth_ed25519\n`\n\nUninstalling the Plugin\n\nYou can uninstall the plugin dynamically by executing UNINSTALL SONAME or UNINSTALL PLUGIN:\n\n`sql\nUNINSTALL SONAME 'auth_ed25519';\n`\n\nIf you installed the plugin by providing the --plugin-load or the --plugin-load-add options in a relevant server option group in an option file, those options must be removed to prevent the plugin from being loaded the next time the server is restarted.\n\nCreating Users\n\nYou can create a user account by executing the CREATE USER statement and providing the IDENTIFIED VIA clause followied by the name of the plugin, ed25519, and providing the USING clause followed by the PASSWORD() function, with the plain-text password as an argument:\n\n`sql\nCREATE USER username@hostname IDENTIFIED VIA ed25519 USING PASSWORD('secret');\n`\n\nIf SQL_MODE does not have NO_AUTO_CREATE_USER set, then you can also create the user account via GRANT:\n\n`sql\nGRANT SELECT ON db. TO username@hostname IDENTIFIED VIA ed25519 USING PASSWORD('secret');\n`\n\nThe PASSWORD() function and SET PASSWORD statements don't work with the ed25519 authentication plugin. Instead, you have to use the UDF that comes with the authentication plugin to calculate the password hash:\n\n`sql\nCREATE FUNCTION ed25519_password RETURNS STRING SONAME "auth_ed25519.so";\n`\n\nNow you can calculate a password hash by executing this query:\n\n`sql\nSELECT ed25519_password("secret");\n+---------------------------------------------+\n| SELECT ed25519_password("secret");          |\n+---------------------------------------------+\n| ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY |\n+---------------------------------------------+\n`\n\nNow you can use it to create the user account using the new password hash. As with any password, you should always use a complex password that isn't easy to guess. If you don't, if anyone gets access to the stored passwords in the mysql.user table, they could use rainbow tables to figure out the original password.\n\nTo create a user account via CREATE USER, specify the name of the plugin in the IDENTIFIED VIA clause while providing the password hash as the USING clause:\n\n`sql\nCREATE USER username@hostname IDENTIFIED VIA ed25519 \n  USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';\n`\n\nIf SQL_MODE does not have NO_AUTO_CREATE_USER set, you can also create the user account via GRANT:\n\n`sql\nGRANT SELECT ON db. TO username@hostname IDENTIFIED VIA ed25519 \n  USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';\n`\n\nNote that users require a password in order to be able to connect. It is possible to create users without specifying a password, but they will be unable to connect.\n\nChanging User Passwords\n\nYou can change a user account's password by executing the SET PASSWORD statement followed by the PASSWORD() function and providing the plain-text password as an argument:\n\n`sql\nSET PASSWORD =  PASSWORD('new_secret')\n`\n\nYou can also change the user account's password with the ALTER USER statement. You would have to specify the name of the plugin in the IDENTIFIED VIA clause while providing the plain-text password as an argument to the PASSWORD() function in the USING clause:\n\n`sql\nALTER USER username@hostname IDENTIFIED VIA ed25519 USING PASSWORD('new_secret');\n`\n\nThe PASSWORD() function and SET PASSWORD statement did not work with the ed25519 authentication plugin. Instead, you would have to use the UDF that comes with the authentication plugin to calculate the password hash:\n\n`sql\nCREATE FUNCTION ed25519_password RETURNS STRING SONAME "auth_ed25519.so";\n`\n\nNow you can calculate a password hash by executing this query:\n\n`sql\nSELECT ed25519_password("secret");\n+---------------------------------------------+\n| SELECT ed25519_password("secret");          |\n+---------------------------------------------+\n| ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY |\n+---------------------------------------------+\n`\n\nNow you can change the user account's password using the new password hash.\n\nYou can change the user account's password with the ALTER USER statement. You have to specify the name of the plugin in the IDENTIFIED VIA clause, while providing the password hash as the USING clause:\n\n`sql\nALTER USER username@hostname IDENTIFIED VIA ed25519 \n  USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';\n`\n\nClient Authentication Plugins\n\nFor clients that use the libmysqlclient or MariaDB Connector/C libraries, MariaDB provides one client authentication plugin that is compatible with the ed25519 authentication plugin:\n\n client_ed25519\n\nWhen connecting with a client or utility to a server as a user account that authenticates with the ed25519 authentication plugin, you may need to tell the client where to find the relevant client authentication plugin by specifying the --plugin-dir option:\n\n`bash\nmysql --plugin-dir=/usr/local/mysql/lib64/mysql/plugin --user=alice\n`\n\nclient_ed25519\n\nThe client_ed25519 client authentication plugin hashes and signs the password using the Elliptic Curve Digital Signature Algorithm (ECDSA) before sending it to the server.\n\nSupport in Client Libraries\n\nUsing the Plugin with MariaDB Connector/C\n\nMariaDB Connector/C supports ed25519 authentication using the client authentication plugins mentioned in the previous section.\n\nUsing the Plugin with MariaDB Connector/ODBC\n\nMariaDB Connector/ODBC supports ed25519 authentication using the client authentication plugins mentioned in the previous section.\n\nUsing the Plugin with MariaDB Connector/J\n\nMariaDB Connector/J supports ed25519 authentication.\n\nUsing the Plugin with MariaDB Connector/Node.js\n\nMariaDB Connector/Node.js supports ed25519 authentication.\n\nUsing the Plugin with MySqlConnector for .NET\n\nMySqlConnector for ADO.NET supports ed25519 authentication.\n\nThe connector implemented support for this authentication plugin in a separate NuGet package called MySqlConnector.Authentication.Ed25519. After the package is installed, your application must call Ed25519AuthenticationPlugin.Install to enable it.\n\nOptions\n\ned25519\n\n Description: Controls how the server should treat the plugin when it starts up.\n   Valid values are:\n     OFF - Disables the plugin without removing it from the mysql.plugins table.\n     ON - Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled.\n     FORCE - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error.\n     FORCE_PLUS_PERMANENT - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled with UNINSTALL SONAME or UNINSTALL PLUGIN while the server is running.\n   See Plugin Overview: Configuring Plugin Activation at Server Startup for more information.\n Command line: --ed25519=value\n Data Type: enumerated\n Default Value: ON\n Valid Values: OFF, ON, FORCE, FORCE_PLUS_PERMANENT`\n\nURL: https://mariadb.com/docs/server/reference/plugins/authentication-plugins/authentication-plugin-ed25519