-
Notifications
You must be signed in to change notification settings - Fork 82
embedded mysql should listen by default on localhost #122
Comments
@jefimm yes, mysql does listen on * instead of explicit Now in |
If MysqldConfig would return the hostname to connect to (set to 127.0.0.1) it would be completely avoided |
@jefimm what I could do is to add option to
Not sure if I would change default - current default '*' is most bulletproof, but whoever is worried about it could change it. Wdyt? |
This would be a step in right direction |
Is there a work around in the meantime? |
@viliusl I don't mind having to set this via reflection, etc. if there is a workaround. Your guidance is much appreciated. And thanks for such a great project! |
@bobtiernay-okta - I there was a suggestion for an extension of api to make it opt-in for now. PR's are welcome and it should be fairly simple addition. If it works as expected we could toggle it on by default in upcoming versions. |
@viliusl I would be willing to take a look if you could point me to the right part of the code. Iirc, this is in Thanks! |
Just a heads up, I was able to get this working without any changes: private EmbeddedMysql createMysqld() {
MysqldConfig config = aMysqldConfig(v5_5_52)
.withServerVariable("bind-address", "localhost")
.build();
return anEmbeddedMysql(config)
.start();
} So perhaps we good already and just need to update the docs? |
@bobtiernay-okta :) once |
How did you manage to get around this? The client still uses localhost, I get the following exception when I try to start the embedded instance:
I can push a fix, should be a matter of fetching the bind address from the config. First add getters to
I believe this only happens if the config contains a user |
We used the workaround suggested by bobtiernay-okta above i.e. adding .withServerVariable("bind-address", "localhost") to the configuration and this worked as advertised to prevent the popups from happening on the Mac. A side-effect seems to have cropped up though. Now, when the shutdown goes to terminate any mysqld instances, the spawned mysqladmin processes sometimes hang. It is intermittent and inconsistent how many processes hang. But, since we are running as part of our JUnit tests, this causes the tests to hang too. We ultimately ended up writing our own shutdown hook to manually terminate all the leftover mysqld and mysqladmin processes. But, we'd like to avoid this if possible. Has anyone else seen this behavior and, if so, have you come up with a solution or better workaround? Interestingly, the code in stopUsingMysqldadmin in MysqldProcess has a comment saying that the code should include a timeout to wait on the mysqladmin process to return. Unfortunately, that has not been implemented yet so the mysqladmin process just hangs indefinitely. |
The mysql opens ipv6 socket to the world, which is not secure and causes unnecessary warnings on MacOS.
from lsof output
IPv6 0x47e09a7bb638616f 0t0 TCP *:dyna-access (LISTEN)
Embedded mysql should listen on localhost only by default
The text was updated successfully, but these errors were encountered: