nixos/piwik: clarifies setup documentation
The piwki setup documentation as it stands has two issues: - the `ALTER USER root` line does not work with MariaDB or MySQL 5.5 - the auth plugin details vary between MariaDB and MySQL
This commit is contained in:
parent
af84611f0c
commit
d690701ff7
@ -23,16 +23,24 @@
|
|||||||
and enter those credentials in your browser.
|
and enter those credentials in your browser.
|
||||||
You can use passwordless database authentication via the UNIX_SOCKET authentication plugin
|
You can use passwordless database authentication via the UNIX_SOCKET authentication plugin
|
||||||
with the following SQL commands:
|
with the following SQL commands:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
# For MariaDB
|
||||||
INSTALL PLUGIN unix_socket SONAME 'auth_socket';
|
INSTALL PLUGIN unix_socket SONAME 'auth_socket';
|
||||||
ALTER USER root IDENTIFIED VIA unix_socket;
|
|
||||||
CREATE DATABASE piwik;
|
CREATE DATABASE piwik;
|
||||||
CREATE USER 'piwik'@'localhost' IDENTIFIED VIA unix_socket;
|
CREATE USER 'piwik'@'localhost' IDENTIFIED WITH unix_socket;
|
||||||
|
GRANT ALL PRIVILEGES ON piwik.* TO 'piwik'@'localhost';
|
||||||
|
|
||||||
|
# For MySQL
|
||||||
|
INSTALL PLUGIN auth_socket SONAME 'auth_socket.so';
|
||||||
|
CREATE DATABASE piwik;
|
||||||
|
CREATE USER 'piwik'@'localhost' IDENTIFIED WITH auth_socket;
|
||||||
GRANT ALL PRIVILEGES ON piwik.* TO 'piwik'@'localhost';
|
GRANT ALL PRIVILEGES ON piwik.* TO 'piwik'@'localhost';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
Then fill in <literal>piwik</literal> as database user and database name, and leave the password field blank.
|
Then fill in <literal>piwik</literal> as database user and database name, and leave the password field blank.
|
||||||
This works with MariaDB and MySQL. This authentication works by allowing only the <literal>piwik</literal> unix
|
This authentication works by allowing only the <literal>piwik</literal> unix user to authenticate as the
|
||||||
user to authenticate as <literal>piwik</literal> database (without needing a password), but no other users.
|
<literal>piwik</literal> database user (without needing a password), but no other users.
|
||||||
For more information on passwordless login, see
|
For more information on passwordless login, see
|
||||||
<link xlink:href="https://mariadb.com/kb/en/mariadb/unix_socket-authentication-plugin/" />.
|
<link xlink:href="https://mariadb.com/kb/en/mariadb/unix_socket-authentication-plugin/" />.
|
||||||
</para>
|
</para>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user