This repository was archived by the owner on Aug 1, 2024. It is now read-only.
File tree 3 files changed +15
-21
lines changed
3 files changed +15
-21
lines changed Original file line number Diff line number Diff line change @@ -470,7 +470,6 @@ dev.dbcopyall8: ## Clean mysql80 container and copy data from old mysql 5.7 cont
470
470
docker volume rm devstack_mysql80_data
471
471
$(MAKE ) dev.up.mysql57+mysql80
472
472
$(MAKE ) dev.wait-for.mysql57+mysql80
473
- sleep 10
474
473
docker compose exec -T mysql80 mysql -uroot mysql < provision-mysql80.sql
475
474
$(MAKE ) $(_db_copy8_targets )
476
475
$(MAKE ) stop
Original file line number Diff line number Diff line change @@ -56,8 +56,18 @@ run_check() {
56
56
mysql_run_check () {
57
57
container_name=" $1 "
58
58
mysql_probe=" SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = 'root')"
59
+ # The use of `--protocol tcp` forces MySQL to connect over TCP rather than
60
+ # via a UNIX socket. This is needed because when MySQL starts for the first
61
+ # time in a new container, it starts a "temporary server" that runs for a
62
+ # few seconds and then shuts down before the "real" server starts up. The
63
+ # temporary server does not listen on the TCP port, but if the mysql
64
+ # command is not told which server to use, it will first try the UNIX
65
+ # socket and only after that will it try the default TCP port.
66
+ #
67
+ # By specifying that mysql should use TCP, we won't get an early false
68
+ # positive "ready" response while the temporary server is running.
59
69
run_check " ${container_name} _query" " $container_name " \
60
- " docker compose exec -T $( printf %q " $container_name " ) mysql -uroot -se $( printf %q " $mysql_probe " ) "
70
+ " docker compose exec -T $( printf %q " $container_name " ) mysql --protocol tcp - uroot -se $( printf %q " $mysql_probe " ) "
61
71
}
62
72
63
73
if should_check mysql57; then
Original file line number Diff line number Diff line change @@ -128,25 +128,10 @@ if needs_mongo "$to_provision_ordered"; then
128
128
docker compose up -d mongo
129
129
fi
130
130
131
- # Ensure the MySQL5 server is online and usable
132
- echo " ${GREEN} Waiting for MySQL 5.7.${NC} "
133
- make dev.wait-for.mysql57
134
-
135
- # Ensure the MySQL8 server is online and usable
136
- echo " ${GREEN} Waiting for MySQL 8.0.${NC} "
137
- make dev.wait-for.mysql80
138
-
139
- # In the event of a fresh MySQL container, wait a few seconds for the server to restart
140
- # See https://github.com/docker-library/mysql/issues/245 for why this is necessary.
141
- sleep 10
142
-
143
- echo " ${GREEN} Waiting for MySQL 5.7 to restart.${NC} "
144
- make dev.wait-for.mysql57
145
- echo -e " ${GREEN} MySQL5 ready.${NC} "
146
-
147
- echo " ${GREEN} Waiting for MySQL 8.0 to restart.${NC} "
148
- make dev.wait-for.mysql80
149
- echo -e " ${GREEN} MySQL8 ready.${NC} "
131
+ # Ensure the MySQL server is online and usable
132
+ echo -e " ${GREEN} Waiting for MySQL.${NC} "
133
+ make dev.wait-for.mysql57+mysql80
134
+ echo -e " ${GREEN} MySQL is ready.${NC} "
150
135
151
136
# Ensure that the MySQL databases and users are created for all IDAs.
152
137
# (A no-op for databases and users that already exist).
You can’t perform that action at this time.
0 commit comments