Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testcontainers root user stoped working with latest mysql container #3893

Closed
george-toader-iq opened this issue Mar 19, 2021 · 1 comment
Closed

Comments

@george-toader-iq
Copy link

george-toader-iq commented Mar 19, 2021

Hello,

A couple of days ago the mysql container got updated and after that our builds started failing because the container would not start.
We use this connection string:
spring.datasource.url=jdbc:tc:mysql:8:///mysql?user=root?password=?TC_INITSCRIPT=schema.sql

We need to use the root user to be able to set some global flags

The container logs show:


2021-03-18 21:04:49+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2021-03-18 21:04:49+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.

2021-03-18 21:04:49+00:00 [ERROR] [Entrypoint]: MYSQL_USER="root", MYSQL_PASSWORD cannot be used for the root user

Use one of the following to control the root user password:

- MYSQL_ROOT_PASSWORD

- MYSQL_ALLOW_EMPTY_PASSWORD

- MYSQL_RANDOM_ROOT_PASSWORD

We tried setting a password for root but that didn't work for us either.

Our quick workaround was to downgrade to 8.0.22, so we now have:
spring.datasource.url=jdbc:tc:mysql:8.0.22:///mysql?user=root?password=?TC_INITSCRIPT=schema.sql

Digging around, we found this issue reported on the container side: docker-library/mysql#750
Looking into this thread it seems that circleCI have fixed this by removing the MYSQL_USER="root".

Does testcontainers need to do the same?
Do you have another recommended way of getting test containers root user working with latest mysql container?

@rnorth
Copy link
Member

rnorth commented Apr 11, 2021

We think this is fixed by #3953, so I'll close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants