mariadb: Use defaults and change default datadir
authorMichal Hrusecky <michal.hrusecky@turris.com>
Mon, 12 Oct 2020 08:50:51 +0000 (10:50 +0200)
committerMichal Hrusecky <michal.hrusecky@turris.com>
Tue, 13 Oct 2020 06:58:29 +0000 (08:58 +0200)
Use /srv/mysql as default datadir as /var/lib/mysql is in tmpfs. This
doesn't affect any existing setup as up till now it had to be always
specified in configuration. That is addressed in the second part of this
commit - init script now uses even defaults as compiled in MariaDB so
not everything has to be specified in configuration file.

Signed-off-by: Michal Hrusecky <michal.hrusecky@turris.com>
utils/mariadb/Makefile
utils/mariadb/files/mysqld.init

index 321ee70a9b6280d7adaf436722a82e15a7b6e3b1..162b0860a5628c646ef48113816cae4eb5276787 100644 (file)
@@ -380,7 +380,7 @@ CMAKE_OPTIONS += \
        -DINSTALL_SQLBENCHDIR="" \
        -DINSTALL_SUPPORTFILESDIR=share/mariadb \
        -DINSTALL_UNIX_ADDRDIR=$(MARIADB_SOCKET) \
-       -DMYSQL_DATADIR=/var/lib/mysql \
+       -DMYSQL_DATADIR=/srv/mysql \
        -DMYSQL_UNIX_ADDR=$(MARIADB_SOCKET) \
        -DSKIP_TESTS=ON \
        -DWITH_DEBUG=OFF \
index 3e35389073f9b0c867cb6a11550bee3e81bf072c..4f23a01de5fea46a73885d5abadb3860a648ed32 100644 (file)
@@ -22,11 +22,7 @@ export HOME="/etc/mysql"
 cd /
 
 mysqld_get_param() {
-       $MYSQLD --print-defaults \
-               | tr " " "\n" \
-               | grep -- "--$1" \
-               | tail -n 1 \
-               | cut -d= -f2
+       /usr/bin/mysqld --help --verbose | sed -n 's|^'"$1"'[[:blank:]]\+||p'
 }
 
 # Checks if a server is running and accessible.