Well, it wasn't the port being blocked by the ISP, because I tried a different port and that didn't work either.
It's not a firewall thing because I have already connected to this db from a remote computer. I just can't connect to it from the x10 server that my script is running off of.