From 927bf98e0e35cbd6d3c8416742f695def8faf90b Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 28 Nov 2020 16:31:41 +0100 Subject: [PATCH] services: MySQL: Make the socket configurable. * gnu/services/databases.scm (): Add SOCKET field. (mysql-configuration-file): Adjust accordingly. * doc/guix.texi (Database Services): Likewise. --- doc/guix.texi | 3 +++ gnu/services/databases.scm | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ae43fb6965..bef42e160a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19145,6 +19145,9 @@ to bind to all available network interfaces. @item @code{port} (default: @code{3306}) TCP port on which the database server listens for incoming connections. +@item @code{socket} (default: @code{"/run/mysqld/mysqld.sock"}) +Socket file to use for local (non-network) connections. + @item @code{extra-content} (default: @code{""}) Additional settings for the @file{my.cnf} configuration file. diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index 8fd87a563d..5a88b70d74 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -467,6 +467,7 @@ storage: (mysql mysql-configuration-mysql (default mariadb)) (bind-address mysql-configuration-bind-address (default "127.0.0.1")) (port mysql-configuration-port (default 3306)) + (socket mysql-configuration-socket (default "/run/mysqld/mysqld.sock")) (extra-content mysql-configuration-extra-content (default ""))) (define %mysql-accounts @@ -482,10 +483,10 @@ storage: (define mysql-configuration-file (match-lambda - (($ mysql bind-address port extra-content) + (($ mysql bind-address port socket extra-content) (mixed-text-file "my.cnf" "[mysqld] datadir=/var/lib/mysql -socket=/run/mysqld/mysqld.sock +socket=" socket " bind-address=" bind-address " port=" (number->string port) " " extra-content "