On some Linux systems, the firewall prevents outgoing connections to the database server.
Here are some possible solutions:
$ sudo service iptables stop
If this fixes the problem, add a permanent rule to allow connections to the database server.
If the above do not solve the issues you have, please contact SQream support, and we will assist you.