Skip to content

Commit 38b5a33

Browse files
authored
v1.2.1 (#10)
Bug fixes * Giving localhost permissions to specified user so healthcheck works correctly Minor updates * Using mariadb binaries * Updating copyright year in healthcheck
1 parent cabc868 commit 38b5a33

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.0
1+
1.2.1

overlay/etc/db/backup

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ THIS_BACKUP_PATH="${BACKUP_PATH}/${DATE}"
1717
#======================================================================================================================
1818

1919
EXCLUDE="mysql|information_schema|performance_schema|sys"
20-
DATABASES=$(mysql -uroot -p${MARIADB_ROOT_PASSWORD} -e 'SHOW DATABASES;' | sed 1d | grep -v -E "(${EXCLUDE})")
20+
DATABASES=$(mariadb -uroot -p${MARIADB_ROOT_PASSWORD} -e 'SHOW DATABASES;' | sed 1d | grep -v -E "(${EXCLUDE})")
2121
[[ -z "${DATABASES}" ]] && _error "No databases found to backup."
2222

2323

@@ -35,7 +35,7 @@ for DATABASE in ${DATABASES} ; do
3535

3636
# dump database and continue on failure
3737
_echo " - ${DATABASE}"
38-
mysqldump --add-locks -uroot -p${MARIADB_ROOT_PASSWORD} ${DATABASE} > ${DUMP_FILE} || true
38+
mariadb-dump --add-locks -uroot -p${MARIADB_ROOT_PASSWORD} ${DATABASE} > ${DUMP_FILE} || true
3939

4040
# set read-only permissions
4141
chmod 440 ${DUMP_FILE}

overlay/etc/db/export

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ EXPORT_FILE="${BACKUP_PATH}/${1}.sql"
1616
#======================================================================================================================
1717

1818
_echo "Exporting database '${1}' to ${EXPORT_FILE}..."
19-
mysqldump --add-locks -uroot -p${MARIADB_ROOT_PASSWORD} "${1}" > "${EXPORT_FILE}" || _error "Unable to export database '${1}'."
19+
mariadb-dump --add-locks -uroot -p${MARIADB_ROOT_PASSWORD} "${1}" > "${EXPORT_FILE}" || _error "Unable to export database '${1}'."
2020
_done

overlay/etc/services.d/mariadb/run

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
create () {
1212
echo "CREATE DATABASE IF NOT EXISTS \`${2}\`;" >> ${1}
13+
echo "GRANT ALL PRIVILEGES ON \`${2}\`.* TO '${3}'@'localhost' IDENTIFIED BY '${4}';" >> ${1}
1314
echo "GRANT ALL PRIVILEGES ON \`${2}\`.* TO '${3}'@'%' IDENTIFIED BY '${4}';" >> ${1}
1415
}
1516

overlay/usr/local/bin/healthcheck

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ set -euo pipefail
77
# Copyright (c) 2015 Thomas Boerger <https://webhippie.de>
88
# Originally from https://github.com/dockhippie/mariadb/blob/master/latest/overlay/etc/s6/mariadb/run
99
#
10-
# Modifications copyright (c) 2020 Ben Green <https://bcgdesign.com>
10+
# Modifications copyright (c) 2021 Ben Green <https://bcgdesign.com>
1111
#======================================================================================================================
1212

1313
USERNAME=${MARIADB_USERNAME:-root}
1414
PASSWORD=${MARIADB_PASSWORD:-${MARIADB_ROOT_PASSWORD}}
1515

16-
CHECK="$(echo 'SELECT 1;' | mysql -h127.0.0.1 -u${USERNAME} -p${PASSWORD} 2>/dev/null | head -n1)"
16+
CHECK="$(echo 'SELECT 1;' | mariadb -h127.0.0.1 -u${USERNAME} -p${PASSWORD} 2>/dev/null | head -n1)"
1717

1818
[[ "${CHECK}" == "1" ]] && exit 0
1919
exit 1

0 commit comments

Comments
 (0)