Go to file
2020-05-22 01:15:01 +02:00
DOC Add '-DWITH_JEMALLOC=OFF' to cmake options if debian 10 (buster) and MariaDB. 2019-06-15 01:41:44 +02:00
Example Add suport for MariaDB 10.4. Compile with default charset utf8. 2019-07-02 15:36:52 +02:00
OLD Save prior version of 'install_mysql.sh' at directory 'OLD'. 2019-05-05 04:03:10 +02:00
.gitignore Add support for MariaDB and Percona MySQL Server. 2018-02-26 03:40:43 +01:00
install_mysql-5.1.sh Initial import 2017-02-19 12:27:15 +01:00
install_mysql.sh install_mysql.sh: fix minor error on my.cnf file creation. 2020-05-22 01:15:01 +02:00
README.missing-socket-directory Add file 'README.missing-socket-directory'. 2020-05-22 01:12:59 +02:00
remove_mariadb_installation.sh Remove also file '/etc/ld.so.conf.d/mysql.conf' if exists. 2018-02-27 18:03:40 +01:00
remove_mysql_installation.sh Remove also file '/etc/ld.so.conf.d/mysql.conf' if exists. 2018-02-27 18:03:40 +01:00
remove_percona_installation.sh Remove also file '/etc/ld.so.conf.d/mysql.conf' if exists. 2018-02-27 18:03:40 +01:00
stopwords_iso8859-15.txt Initial import 2017-02-19 12:27:15 +01:00
stopwords_utf8_iso8859-15.txt Initial import 2017-02-19 12:27:15 +01:00
stopwords_utf8.txt Initial import 2017-02-19 12:27:15 +01:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

##
#
# MySQL and MariaDB socket-file/pid-file folder issues  how to fix
#
##

# ----------
# There are 2 possibilities to force creating a folder on ech boot.
# ----------


# ----------
#
# 1.) Add 'ExecStartPre' directive to systemd service file:
#
#    ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld
#
# ----------

MYSQL_USER=mysql
SOCKET_DIR="/var/run/mysqld"
MYSQL_SERVICE_FILE="/root/mysql.service"

perl -i -n -p -e "s&^(PermissionsStartOnly=.*)&\1\n\nExecStartPre=/usr/bin/install -m 755 -o $MYSQL_USER -g root -d $SOCKET_DIR&" $MYSQL_SERVICE_FILE 


# ----------
#
# 2.) Create file /etc/tmpfiles.d/mysql.conf file with content:
#
#    # systemd tmpfile settings for mysql or mariadb
#    d /var/run/mysqld 0755 mysql mysql -
#
# see also: 
#    https://www.ryadel.com/en/linux-mysql-mariadb-pid-file-folder-fix/
#
# ----------

# Force systemd to create such folder on each startup.  We can easily do that following the steps below:
#
#    - Create a new /etc/tmpfiles.d/mysql.conf file with content:
#
#       # systemd tmpfile settings for mysql or mariadb
#       d /var/run/mysqld 0755 mysql mysql -
#
cat <<EOF > /etc/tmpfiles.d/mysql.conf
# systemd tmpfile settings for mysql or mariadb
d /var/run/mysqld 0755 mysql mysql -
EOF