Skip to content

Commit

Permalink
Fix script/docker-gh-ost-replica-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chen-anders committed Jan 28, 2025
1 parent 85b26b7 commit 1b3f7f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions script/docker-gh-ost-replica-tests
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@ setup() {
poll_mysql "replica" || exit 1

echo -n "Setting up replication..."
gh-ost-test-mysql-master -e "create user if not exists 'repl'@'%' identified with 'mysql_native_password' by 'repl';"
if [[ $TEST_MYSQL_IMAGE =~ "mysql:8.4" ]]; then
gh-ost-test-mysql-master -e "create user if not exists 'repl'@'%' identified with 'caching_sha2_password' by 'repl';"
else
gh-ost-test-mysql-master -e "create user if not exists 'repl'@'%' identified with 'mysql_native_password' by 'repl';"
fi
gh-ost-test-mysql-master -e "grant replication slave on *.* to 'repl'@'%'; flush privileges;"
gh-ost-test-mysql-master -e "create user if not exists 'gh-ost'@'%' identified by 'gh-ost';"
gh-ost-test-mysql-master -e "grant all on *.* to 'gh-ost'@'%';"

sleep 1
if [[ $TEST_MYSQL_IMAGE =~ "mysql:8.4" ]]; then
gh-ost-test-mysql-replica -e "change replication source to to source_host='mysql-primary', source_port=3307, source_user='repl', source_password='repl', source_auto_position=1;"
gh-ost-test-mysql-replica -e "change replication source to source_host='mysql-primary', source_port=3307, source_user='repl', source_password='repl', source_auto_position=1;"
gh-ost-test-mysql-replica -e "start replica;"
else
gh-ost-test-mysql-replica -e "change master to master_host='mysql-primary', master_port=3307, master_user='repl', master_password='repl', master_auto_position=1;"
Expand Down

0 comments on commit 1b3f7f4

Please sign in to comment.