MySQL data source: "Address already in use: bind"
I used to have a happy connection to my local database (running on a Vagrant VM), but sometime recently (possibly related to upgrading PHPStorm to 2023.3 - I'm not sure), it stopped working. At first it said it didn't have the driver, but one click seemed to solve that. Then it just complained that it couldn't connect (nothing specific, and I don't remember the wording now), so I followed instructions I found in several places on the web. Now I'm getting an error that no one is talking about, so I'm stumped.
First of all, here is the SSH/SSL tab plus the SSH Configuration popup:
As you can see, that connection succeeds. But here is the General tab, and the error I'm getting:
Searching the web for “Address already in use: bind” does not produce any results that seem relevant to a MySQL connection. Can someone spot a problem with my configuration?
请先登录再写评论。
You are trying to use port 2222 for the tunnel, but this port is already listened on by Vagrant.
Please clear the ‘Local port’ field - you don't need to specify it, a dynamic one would totally do.
Hmm, I tried what you said, but now the step that previously passed the connection test doesn't anymore. It says, “SSH: Connection refused: connect.”
The configuration field (which I can't edit directly) now has 22 as the port, although the Local Port field below it says “<Dynamic>”. But I can't get that 22 out of there - if I click on “…” to open the SSH Configurations dialog, removing the port just puts a gray 22 there. And the test in that window also fails.
That's weird that you can't edit the port. What if you create a new SSH configuration and enter the same field values there, and then use this new configuration in SSH/SSL - would that work?
I can edit the port, but when I remove the value completely, it assumes 22. With 2222 it works, but not with nothing (which then assumes 22).
Hmm, the original problem got well on its own! I just now changed the port back to 2222, and when I closed the SSH Configurations window and clicked Test Connection in the parent window (expecting it to still fail), it worked! Time has passed - perhaps whatever was already using the address timed out and went away.