-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
MySQL root access is difficult to obtain #2689
base: main
Are you sure you want to change the base?
Conversation
|
||
Connection connection = DriverManager.getConnection(db.getJdbcUrl(), "root", "test"); | ||
connection.createStatement().execute("SELECT 1"); | ||
connection.createStatement().execute("set sql_log_bin=0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used mysql/mysql-server:5.7.30
and this fails for me due to Access denied for user 'root'@'172.17.0.1'
.
It looks like .withEnv("MYSQL_ROOT_HOST", "%")
will also be needed.
… MySQL container as root
…CI (#2531) * Harmonize /test and /publish commands on github * Make normalization build on clean system without PyICU see https://getdbt.slack.com/archives/C50NEBJGG/p1615803416053800?thread_ts=1615511262.026400&cid=C50NEBJGG * Follow example from testcontainers/testcontainers-java#2689 to modify MySQL container as root * Add docs on new syntax for /test
@rnorth @ysb33r I've tried this: try (
MySQLContainer<?> db = new MySQLContainer<>("mysql:5.7.36")
.withUsername("test")
.withPassword("test")
.withEnv("MYSQL_ROOT_PASSWORD", "test")
.withEnv("MYSQL_ROOT_HOST", "%")
) {
db.start();
Connection connection = DriverManager.getConnection(db.getJdbcUrl(), "root", "test");
connection.createStatement().execute("SELECT 1");
connection.createStatement().execute("set sql_log_bin=0");
} And I keep getting:
Using the latest version:
Are there any other workarounds or anything I might be missing? Thanks in advance! |
I don't know. I set up the database in the same way that you've done in the example and it works for me. |
Currently only a test to demonstrate #2627