To eleiminate firewall settings (iptables in post above), you can try to telnet to the mysql server
telnet hostname 3306
telnet ipaddress 3306
If you get something like
Host 'aa.bb.cc' is not allowed to connect to this MySQL server
it's the MySQL server that denies you access. If you get a timeout, it's the firewall.
I guess it will be the latter as the application that you use seem to hang.
PS I assume it's running on the standard port (3306).