如果报错no suitable driver found for jdbc
是spark没有合适的jdbc连接驱动,需要下一个jdbc connector的jar包放到spark路径下并把次路径放到spark/conf/spark-env.sh的SPARK_CLASSPATH里
如:export
SPARK_CLASSPATH=$SPARK_CLASSPATH:/root/spark/mysql-connector-java-5.1.35.jar
如果报ERROR 1130: Host ’x′ is not allowed to connect to this MySQL server则是对面MySQL做了ip限制,本机无权限访问mysql
grant all privileges on database.* to [email protected]‘ ‘ identified by ‘user‘ with grant option;
flush privileges;
时间: 2024-10-13 10:28:37