MySQL login security can include the originating hosts in addition to user and password, so logins may fail for that reason. Then add your date option to see if that is the problem. Use a basic connection string without options first. It provides reasonably good output on connection failure, so you may want to try it. It is a Java application which uses JDBC to access the databases. To enable it, change the listen address to 0.0.0.0 in your mysql configuration and restart. It is typicall to allow remote connections. Debian by default should listen on TCP address localhost:3306. If it isn't listening you won't be able to connect. To see if it is listening run the netstat command above. There are two locatiosn where port is defined, so check both. Check the port to see if it has been moved to a non-standard port. Using an SSH Tunnel Only in DbVisualizer Pro This feature is only available in the DbVisualizer Pro edition. If it is only listening on an address other than 127.0.0.1, try substituting localhost with that address.įrom what I see your mysql configuration should be good. If it is only listening on '127.0.0.1', you will need to run your Java application on the same server, or tunnel the connection. The command 'netstat -lnt | grep 3306' will tell you if mysql is running and listening on the port. Your connect string needs to refer to it instead of localhost. ![]() If it works on another server, then that server is the one hosting the mysql database. Perhaps theres something I need to tweak in the mysql setup. From what I can tell mysql can only have one bind address. I can telnet from the local machine using the IP, but still can't connect with JDBC to it. Replace sshuser with an SSH user for your HDInsight cluster, and replace CLUSTERNAME with the name of your HDInsight cluster: Windows Command Prompt. The bind address in my.cnf is set to the server IP - not 127.0.0.1. Use the following command to create an SSH tunnel using the ssh command. Connection Issues - DbVisualizer Users Guide invalid port number in database url mean Web9. Any ideas whats going wrong here and how I can fix it?Īfter temporarily resetting the iptables setup I'm starting to doubt that is where the problem is and it may be to do with the mysql config. Click the SSH/SSL tab and select the Use SSH tunnel checkbox. I would have thought that localhost connections would work by default, but apparently not. When I telnet localhost 3306, My connection is refused however, when I telnet the sever from another machine on port 3306 I can connect (the server accepts remote connections on the LAN). ![]() I think it has to do with my iptables setup. When ran, I get: .jdbc4.CommunicationException: Communications link failure Where the username, dbname and password are set correctly. Heres the connection code: String db = "jdbc:mysql://localhost:3306/"+database+Ĭonnect = DriverManager.getConnection(db, username, password) ![]() I have a java application that runs on my work machine, but wont connect on the production server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |