diff --git a/nixos/modules/services/web-apps/piwik-doc.xml b/nixos/modules/services/web-apps/piwik-doc.xml
index a1d8a5b7556..21342d4454f 100644
--- a/nixos/modules/services/web-apps/piwik-doc.xml
+++ b/nixos/modules/services/web-apps/piwik-doc.xml
@@ -23,16 +23,24 @@
and enter those credentials in your browser.
You can use passwordless database authentication via the UNIX_SOCKET authentication plugin
with the following SQL commands:
+
+ # For MariaDB
INSTALL PLUGIN unix_socket SONAME 'auth_socket';
- ALTER USER root IDENTIFIED VIA unix_socket;
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';
+
Then fill in piwik 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 piwik unix
- user to authenticate as piwik database (without needing a password), but no other users.
+ This authentication works by allowing only the piwik unix user to authenticate as the
+ piwik database user (without needing a password), but no other users.
For more information on passwordless login, see
.