You are not logged in.
ArchLinux 6.10. NetBeans 6.8. Everything is today-updated. MySQL runs without errors and PhpMyAdmin successfully connects to it. skip-network is off in every my.cnf. -J-Djava.net.preferIPv4Stack=true is set in netbeans.conf. NetBeans reaches its update server as well as local (but over network through localhost) GlassFish-V3 server without problems.
But when I try to add a connection to MySQL in NetBeans says "unable to connect! cannot establish connection to jdbc:mysql://localhost:3306/consult using com.mysql.jdbc.Driver (communications link failure last packet sent to the server was 0ms ago)".
Any guess how to fix this?
Thanks a lot in advance.
Last edited by StrangeAttractor (2010-06-14 04:02:29)
Offline
Is `skip-networking' commented out in /etc/mysql/my.cnf? Also, verify that mysqld is listening on port 3306 with the command `netstat -tln | grep 3306'.
Offline
Is `skip-networking' commented out in /etc/mysql/my.cnf?
Yes, of course, as I've already specified above.
Also, verify that mysqld is listening on port 3306 with the command `netstat -tln | grep 3306'.
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
I don't yet know how to interpret this, I've just switched to Arch Linux fom Windows XP less than a week ago.
Last edited by StrangeAttractor (2010-06-14 04:51:43)
Offline
I do belive you need this:
http://www.mysql.com/downloads/connector/j/
Wich is in the aur:
aur/mysql-jdbc 5.1.12-1 (133)
The official JDBC driver for MySQL
Offline
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
I don't yet know how to interpret this, I've just switched to Arch Linux fom Windows XP less than a week ago.
That means that MySQL is indeed listening for incoming connections on port 3306.
Try toffyrn's suggestion.
Offline
I do belive you need this:
http://www.mysql.com/downloads/connector/j/Wich is in the aur:
aur/mysql-jdbc 5.1.12-1 (133)
The official JDBC driver for MySQL
Installed from AUR. Nothing changed. The error (exactly the same) persists.
I believe MySQL JDBC drier is always included by default in the full distribution of either Sun JDK or NetBeans or MySQL as I have never before had to install it separately, the actual error does not say any classes are missing, the MySQL driver appears in the list in NetBeans.
Last edited by StrangeAttractor (2010-06-15 06:46:47)
Offline
By the way, I've just tried XAMPP and found NetBeans connecting to XAMPP-bundled MySQL without any problems (which absolutely does not mean the problem is solved - I wouldnt like to give up using normal system-instelled MySQL). This makes me to conclude that the problem is in MySQL. How can that be? As we've found above, MySQL listens on default port. PhpMyAdmin also works without problems as well as command-line mysql, skip-network is off.
Last edited by StrangeAttractor (2010-06-15 07:20:17)
Offline
it appears we got tricked by tcp_wrappers. If you run the `mysql' client with `-h localhost' it will still connect through the socket; to force it use the network, you also have to specify `--protocol=TCP'. If you do that, it'll fail to connect just like Netbeans.
So, you should be able to solve the problem you're facing by learning about tcp_wrappers (`man 5 hosts_access') and then editing /etc/hosts.allow accordingly to allow local connections to the MySQL server (maybe add a line containing `mysqld: LOCAL'.)
Hope this works for you.
Offline
editing /etc/hosts.allow accordingly to allow local connections to the MySQL server (maybe add a line containing `mysqld: LOCAL'.)
Thanks a lot, foutrelis, this has solved the problem.
Offline
I just commented out the mysqld lines from /etc/hosts.allow & commented out the ALL:ALL lines from /etc/hosts.deny and it worked. Was the only difference I could find from the Win/MySqld versus the *NIX versions. I thought that hosts.allow and hosts.deny were standard *NIX demons, but I guess they are part of tcp_wrappers with this distro. I was not finding anything under the '08S01' error message posts.
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline