Authentication with unix_socket

Overview

The unix_socket authentication plugin provides authentication as the operating system user when connected via Unix domain socket.

Unix Domain Socket

The unix_socket authentication plugin only works when connected via Unix domain socket.

The Unix domain socket used by the server is configured by the socket system variable.

When connecting to the server using mariadb client, the path to the Unix domain socket can be specified via the --socket option:

$ mariadb --socket=/mariadb/data/mariadb.sock

Create User

To create a user account that uses the unix_socket authentication plugin, specify the plugin in the CREATE USER statement:

CREATE USER 'USER'@'localhost'
   IDENTIFIED VIA unix_socket;