test: mysql-log-bin - add password

MariaDB-11.4 added a default self-signed TLS cert. With this
in the cases where there is no secure password there will be a TLS
error. By setting the password, the connection can continue.

Adding the password is compatible with MySQL and equivalents.
This commit is contained in:
Daniel Black 2024-02-21 10:26:26 +11:00
parent 8c5724da26
commit 949c7dfd2e
1 changed files with 3 additions and 1 deletions

View File

@ -6,9 +6,10 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
image="$1"
cname="mysql-container-$RANDOM-$RANDOM"
rootpass="secret$RANDOM-$RANDOM"
cid="$(
docker run -d \
-e MYSQL_ALLOW_EMPTY_PASSWORD=1 \
-e MYSQL_ROOT_PASSWORD="$rootpass" \
--name "$cname" \
"$image" \
--log-bin="foo-$RANDOM" \
@ -23,6 +24,7 @@ mysql() {
"$image" \
-euc 'if command -v mariadb > /dev/null; then exec mariadb "$@"; else exec mysql "$@"; fi' -- \
-uroot \
-p"$rootpass" \
-hmysql \
--silent \
"$@"