1

MariaDB has pluggable authentication, like PostgreSQL. Unlike PostgreSQL, I can't figure out how to support two forms of auth for a user. For instance, in PostgreSQL we can have the following in our pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD
host    all             all             all                     md5
local   all             all                                     peer

This permits

  1. all users to connect using password auth
  2. all users that are local to connect using the peer method

How do I make it so all local users can connect over Unix sockets if they're authenticated with the operating system, and with a password in the event one is set in the database?

MariaDB provides

  • mysql_native_password
  • unix_socket

It seems the mysql.user only supports one "plugin"

MariaDB [mysql]> SELECT user,host,plugin FROM user;
+------+-----------+-------------+
| user | host      | plugin      |
+------+-----------+-------------+
| root | localhost | unix_socket |
+------+-----------+-------------+
1 row in set (0.00 sec)
2

As you said, a given user can only support one plugin. It is described in more details in the MySQL manual.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.