Skip to main content

Posts

Showing posts from 2010

How to Connect mysql through JDBC connector through Tomcat or externally.

Solution: This can happen for a variety of reasons. I just saw it myself a few weeks ago but I can't remember what the fix was for me. 1) Verify the address mysql is bound to, it's probably 127.0.0.1 (only) which I believe is the default (at least on standard Ubuntu server). You'll have to comment out the bind-address parameter in my.cnf to bind to all available addresses (you can't choose multiple, it's one or all). 2) If it is bound to 127.0.0.1 and you can't connect using "localhost", make sure it's not resolving to the IPv6 localhost address instead of IPv4. (or just use the IP address) 3) Double and triple-check the port that mysql is listening on. 4) Make sure you're using the right JDBC connector for your JDK. 5) Make sure you're not doing something really silly like starting mysql with --skip-networking.