Connection error using SQL Importer when connecting MySQL


#1

I’m trying to import data from MySQL database into MapDB using SQL-importer by running this

java -cp /usr/local/bin/mapdjdbc-1.0-SNAPSHOT-jar-with-dependencies.jar:/usr/local/bin/mapd-1.0-SNAPSHOT-jar-with-dependencies.jar:./mysql-jdbc-driver/mysql-connector-java-5.1.38.jar com.mapd.utility.SQLImporter -t <target_tablename> -ss "select * from <src_dbname>.<src_tablename>" -c "jdbc:mysql://<src_hostname>:3306/<src_dbname>" -su root -sp ""

But I get this error

2017-05-26 19:17:30 INFO SQLImporter:executeQuery:191 - Connecting to database url :jdbc:mysql://:3306/
2017-05-26 19:17:30 ERROR SQLImporter:createMapDConnection:381 - Connection failed - org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)

I confirmed that I’m able to connect the same MySQL database using MySQL client.

Any ideas what am I missing and how to resolve this?


#2

Hi,

You do not appear to have specified the MapD server, user or password.

Are you running it local to the MapD server with all default parameters?

regards


#3

Yes that’s correct I’m running this on the same instance as MapD server.

I also tried adding these options " -s localhost -db mapd -p " still the same result. Also the error seems to be arising from connecting to mysql DB based on the log output.


#4

Hi,

From your initial report

The error is a failure to communicate with a running MapD server, the connection is being refused.

By default it will attempt to connect with these default parameters
–server localhost
–user mapd
–passwd HyperInteractive
–database mapd
–port 9091

If I deliberatley set a bad port i will get same error

java -cp mapd-1.0-SNAPSHOT-jar-with-dependencies.jar:/data/mysql/mysql-connector-java-5.1.39-bin.jar com.mapd.utility.SQLImporter -t test1 -sp thepassword -su root -c jdbc:mysql://localhost -ss "select * from employees.employees" --port 65
2017-05-26 13:17:23 INFO  SQLImporter:executeQuery:191 - Connecting to database url :jdbc:mysql://localhost
Fri May 26 13:17:23 PDT 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2017-05-26 13:17:23 ERROR SQLImporter:createMapDConnection:381 - Connection failed - org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)

Please confirm your server is running

Regards


#5

Yes that was it, Mapd was down and adding the options helped and now I’m able to import a sample table with one row and all VARCHAR columns worked. Thanks for the tip!