Comments - Authentication Plugin - Unix Socket

1 month ago BeWog D

Not very clear. On Debian GNU/Linux 12.8 (bookworm), I use official script to install 11.4 server version (mariadb_repo_setup.sh --mariadb-server-version=11.4)

Then, i execute this query "SELECT host, user, password, plugin,authentication_string FROM mysql.user;"

HostUserPasswordpluginauthentication_string
localhostmariadb.sysmysql_native_password
localhostrootinvalidmysql_native_passwordinvalid
localhostmysqlinvalidmysql_native_passwordinvalid

As you can see, root authentification is "mysql_native_password" and not "unix_socket".

I don't understand.

 
1 month ago Sergei Golubchik

Since 10.4 (see authentication-from-mariadb-10-4) authentication for root as configured as

CREATE USER root@localhost IDENTIFIED VIA unix_socket OR mysql_native_password USING 'invalid'

but mysql.user has only one column "plugin" it cannot show two plugins. Which is why mysql.user is deprecated since 10.4, it's not used to store the authentication information. mysql.global_priv is used for that and mysql.user is a view over mysql.global_priv, it shows only what it is able to show. One plugin out of two.

Select from mysql.global_priv or use SHOW CREATE USER

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.