使用spark操作远程的mysql数据库

使用spark(192.168.1.40)操作远程的mysql数据库(192.168.110.224)
两台服务器不在同一网段!有影响吗?怎么破?程序报错如下:
scala> val jdbcDF =spark.read.format("jdbc").option("driver","com.mysql.jdbc.Driver").option("url","jdbc:mysql://192.168.1.40:3306/wisvdi").option("dbtable","assignment").option("user","root").option("password","root").load();
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)

java.net.ConnectException: Connection timed out l连接超时,很可能是你的mysql服务器的ip端口不对,服务器没有运行起来,或者防火墙阻止了连接。

你可以看下这里,看看能否解决 http://blog.csdn.net/chengliang0315/article/details/55194931

你好,请问你解决这个问题没有,我也遇到这个问题,谢谢!