MySQL Forums
Forum List  »  General

Re: Can't connect to local DB using IP instead of localhost
Posted by: Maxim Markaitis
Date: May 14, 2014 02:37AM

>> I use MySQL 5.2

>There is no such MySQL version.

well 5.2 is Workbench version
I use MySQL 5.5




>> I need my server could be connectable from another hosts.

>On your LAN, it will be accessible via IP address or machine name. The mysql.user.host value for the username you are logging in as needs to match the value you are using, either specifically or as a wildcard. And make sure bind-address is not set.

I can't connect it using with that connection string using its IP even from the server machine.
And when it's localhost or 127.0.0.1 everything is fine.
Firewall is off.
Socket can not be bind as I can connect to this port using "localhost".
Right?

getConnection("jdbc:mysql://localhost:3306/customers", "root", "mypass"); OK
getConnection("jdbc:mysql://127.0.0.1:3306/customers", "root", "mypass"); OK
getConnection("jdbc:mysql://111.222.333.444:3306/customers", "root", "mypass"); FAIL (my ip instead of 11...)

netstat -ano returns
TCP 127.0.0.1:3306 127.0.0.1:2523 ESTABLISHED 3960
it is PID of mysqld.exe

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.