{"id":1221,"date":"2021-01-02T22:56:55","date_gmt":"2021-01-02T22:56:55","guid":{"rendered":"https:\/\/www.ishygddt.xyz\/~blog\/?p=1221"},"modified":"2022-03-08T19:00:01","modified_gmt":"2022-03-08T19:00:01","slug":"mysql-authenticate-via-unix-user-or-password","status":"publish","type":"post","link":"http:\/\/www.ishygddt.xyz\/~blog\/2021\/01\/mysql-authenticate-via-unix-user-or-password","title":{"rendered":"MySQL: authenticate via Unix user OR password"},"content":{"rendered":"<p>Starting with MariaDB 10.4 (released in June 2019), <a href=\"https:\/\/mariadb.com\/kb\/en\/authentication-from-mariadb-104\/\">you can use the <code class=\"language-sql\" data-line=\"\">OR<\/code> keyword with <code class=\"language-sql\" data-line=\"\">IDENTIFIED VIA<\/code><\/a> to allow any-of several authentication methods:<\/p>\n<pre><code class=\"language-sql\" data-line=\"\">CREATE OR ALTER USER `minecraft` \n\tIDENTIFIED VIA unix_socket \n\t            OR mysql_native_password USING PASSWORD(&quot;s3cr3tpasswvrd&quot;);<\/code><\/pre>\n<p>Even if your OS vendor kinda sucks at providing updates, MariaDB provides <a href=\"https:\/\/mariadb.org\/download\/#mariadb-repositories\" rel=\"nofollow noreferrer\">an official repository<\/a>\u00a0serving\u00a0<em>at least<\/em> this version to distributions <em>as old as<\/em> Ubuntu 14.04, CentOS &amp; RHEL 6, Debian 7, and Fedora 28 (all of which are already EOL), as well as up to current releases of each; this is by no means a \"new, shiny, unsupported syntax feature\". (For some of these [<a href=\"http:\/\/yum.mariadb.org\/10.4\/fedora28-amd64\/\" rel=\"nofollow noreferrer\">e.g. Fedora &lt; 32<\/a>], the URL isn't publicly listed, but it still exists.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Starting with MariaDB 10.4 (released in June 2019), you can use the OR keyword with IDENTIFIED VIA to allow any-of several authentication methods: CREATE OR ALTER USER `minecraft` IDENTIFIED VIA unix_socket OR mysql_native_password USING PASSWORD(&quot;s3cr3tpasswvrd&quot;); Even if your OS vendor kinda sucks at providing updates, MariaDB provides an official repository\u00a0serving\u00a0at least this version to distributions &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[96],"tags":[67,66,143],"class_list":["post-1221","post","type-post","status-publish","format-standard","hentry","category-howto","tag-authentication","tag-mariadb","tag-sql"],"_links":{"self":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts\/1221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/comments?post=1221"}],"version-history":[{"count":7,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts\/1221\/revisions"}],"predecessor-version":[{"id":1230,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts\/1221\/revisions\/1230"}],"wp:attachment":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/media?parent=1221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/categories?post=1221"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/tags?post=1221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}