MariaDB already supports authenticating as OS users such as root, when use by UNIX domain sockets for communications:
Hello, I’ve submitted a proposal to the MySQL team to allow the system administrator, when logging in via a local socket that indicates reliably that the DB client is the superuser (e.g., SO_PEERCRED in Linux), to not need a password. As implemented, my suggestion allows root to log in as any user. The rationale is that the system administrator can do anything on the server (including manual edits to the DB files) anyway; thus, every user already implicitly trusts that user with their data. This will simplify DB administration on several levels, but most conspicuously because a lost DB admin password will no longer necessitate the awkward one-time-init-file recovery method. Would MariaDB be interested in this proposal?-FG_______________________________________________Mailing list: https://launchpad.net/~maria-discussPost to : maria-discuss@lists.launchpad.netUnsubscribe : https://launchpad.net/~maria-discussMore help : https://help.launchpad.net/ListHelp