Skip to content

Commit

Permalink
Disable MySQL binary logging
Browse files Browse the repository at this point in the history
  • Loading branch information
muhme committed Dec 3, 2024
1 parent bd1358f commit 10919e9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.32
2.1.0
29 changes: 21 additions & 8 deletions scripts/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ function help {
$(random_quote)"
}

# Wait until MySQL database is up and running
#
function waitForMySQL {
MAX_ATTEMPTS=60
attempt=1
until docker exec jbt-mysql mysqladmin ping -h"127.0.0.1" --silent || [ $attempt -eq $MAX_ATTEMPTS ]; do
log "Waiting for MySQL to be ready, attempt $attempt of $MAX_ATTEMPTS"
attempt=$((attempt + 1))
sleep 1
done
# If the MAX_ATTEMPTS are exceeded, simply try to continue.
}

# shellcheck disable=SC2207 # There are no spaces in version numbers
allUsedBranches=($(getAllUsedBranches))

Expand Down Expand Up @@ -143,17 +156,17 @@ fi

# Wait until MySQL database is up and running
# (This isn't accurate when using MariaDB or PostgreSQL, but so far it's working with the delay from MySQL.)
MAX_ATTEMPTS=60
attempt=1
until docker exec jbt-mysql mysqladmin ping -h"127.0.0.1" --silent || [ $attempt -eq $MAX_ATTEMPTS ]; do
log "Waiting for MySQL to be ready, attempt $attempt of $MAX_ATTEMPTS"
attempt=$((attempt + 1))
sleep 1
done
# If the MAX_ATTEMPTS are exceeded, simply try to continue.
waitForMySQL

if [ "$recreate" = false ]; then

# Disable MySQL binary logging to prevent waste of space
# see https://github.com/joomla-docker/docker-joomla/issues/197
log "Disable MySQL binary logging"
docker exec jbt-mysql bash -c "sed -i '/^\[mysqld\]/a skip-log-bin' '/etc/my.cnf'"
docker restart jbt-mysql
waitForMySQL

# For the tests we need old-school user/password login, once over TCP and once for localhost with Unix sockets
log "Enable MySQL user root login with password"
docker exec jbt-mysql mysql -uroot -proot \
Expand Down

0 comments on commit 10919e9

Please sign in to comment.