From 4b41febf9c73d9d933b4873edadf9693ae4d5bb3 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 11 Dec 2016 21:17:40 +0000 Subject: [PATCH] services: mysql: Add port to configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * gnu/services/databases.scm (): Add port field. (mysql-configuration-file): Use the port field when creating the configuration file. * doc/guix.texi (Database Services): Document it. Co-authored-by: Ludovic Courtès --- doc/guix.texi | 3 +++ gnu/services/databases.scm | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 0cb1bc766..f1c5963f7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10177,6 +10177,9 @@ or @var{mysql}. For MySQL, a temporary root password will be displayed at activation time. For MariaDB, the root password is empty. + +@item @code{port} (default: @code{3306}) +TCP port on which the database server listens for incoming connections. @end table @end deftp diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index 1eed85542..f7e08e696 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -160,7 +160,8 @@ and stores the database cluster in @var{data-directory}." (define-record-type* mysql-configuration make-mysql-configuration mysql-configuration? - (mysql mysql-configuration-mysql (default mariadb))) + (mysql mysql-configuration-mysql (default mariadb)) + (port mysql-configuration-port (default 3306))) (define %mysql-accounts (list (user-group @@ -175,10 +176,11 @@ and stores the database cluster in @var{data-directory}." (define mysql-configuration-file (match-lambda - (($ mysql) - (plain-file "my.cnf" "[mysqld] + (($ mysql port) + (mixed-text-file "my.cnf" "[mysqld] datadir=/var/lib/mysql socket=/run/mysqld/mysqld.sock +port=" (number->string port) " ")))) (define (%mysql-activation config) -- 2.11.4.GIT