File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 1616fi
1717
1818mysql () {
19- mysql_8_2
19+ mysql_9_2
2020}
2121
2222mysql_8_0 () {
@@ -91,6 +91,30 @@ mysql_8_2() {
9191 fi
9292}
9393
94+ mysql_9_2 () {
95+ $CONTAINER_CLI rm -f mysql || true
96+ $CONTAINER_CLI run --name mysql -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d ${DB_IMAGE_MYSQL_9_2:- docker.io/ mysql: 9.2.0} --character-set-server=utf8mb4 --collation-server=utf8mb4_0900_as_cs --skip-character-set-client-handshake --log-bin-trust-function-creators=1 --lower_case_table_names=2
97+ # Give the container some time to start
98+ OUTPUT=
99+ n=0
100+ until [ " $n " -ge 5 ]
101+ do
102+ # Need to access STDERR. Thanks for the snippet https://stackoverflow.com/a/56577569/412446
103+ { OUTPUT=" $( { $CONTAINER_CLI logs mysql; } 2>&1 1>&3 3>& - ) " ; } 3>&1 ;
104+ if [[ $OUTPUT == * " ready for connections" * ]]; then
105+ break ;
106+ fi
107+ n=$(( n+ 1 ))
108+ echo " Waiting for MySQL to start..."
109+ sleep 3
110+ done
111+ if [ " $n " -ge 5 ]; then
112+ echo " MySQL failed to start and configure after 15 seconds"
113+ else
114+ echo " MySQL successfully started"
115+ fi
116+ }
117+
94118mariadb () {
95119 mariadb_11_7
96120}
You can’t perform that action at this time.
0 commit comments