File tree Expand file tree Collapse file tree 5 files changed +7
-6
lines changed Expand file tree Collapse file tree 5 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
- 1.2.0
1
+ 1.2.1
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ THIS_BACKUP_PATH="${BACKUP_PATH}/${DATE}"
17
17
#======================================================================================================================
18
18
19
19
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})")
21
21
[[ -z "${DATABASES}" ]] && _error "No databases found to backup."
22
22
23
23
@@ -35,7 +35,7 @@ for DATABASE in ${DATABASES} ; do
35
35
36
36
# dump database and continue on failure
37
37
_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
39
39
40
40
# set read-only permissions
41
41
chmod 440 ${DUMP_FILE}
Original file line number Diff line number Diff line change @@ -16,5 +16,5 @@ EXPORT_FILE="${BACKUP_PATH}/${1}.sql"
16
16
#======================================================================================================================
17
17
18
18
_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}'."
20
20
_done
Original file line number Diff line number Diff line change 10
10
11
11
create () {
12
12
echo "CREATE DATABASE IF NOT EXISTS \`${2}\`;" >> ${1}
13
+ echo "GRANT ALL PRIVILEGES ON \`${2}\`.* TO '${3}'@'localhost' IDENTIFIED BY '${4}';" >> ${1}
13
14
echo "GRANT ALL PRIVILEGES ON \`${2}\`.* TO '${3}'@'%' IDENTIFIED BY '${4}';" >> ${1}
14
15
}
15
16
Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ set -euo pipefail
7
7
# Copyright (c) 2015 Thomas Boerger <https://webhippie.de>
8
8
# Originally from https://github.com/dockhippie/mariadb/blob/master/latest/overlay/etc/s6/mariadb/run
9
9
#
10
- # Modifications copyright (c) 2020 Ben Green <https://bcgdesign.com>
10
+ # Modifications copyright (c) 2021 Ben Green <https://bcgdesign.com>
11
11
#======================================================================================================================
12
12
13
13
USERNAME=${MARIADB_USERNAME:-root}
14
14
PASSWORD=${MARIADB_PASSWORD:-${MARIADB_ROOT_PASSWORD}}
15
15
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)"
17
17
18
18
[[ "${CHECK}" == "1" ]] && exit 0
19
19
exit 1
You can’t perform that action at this time.
0 commit comments