Upload 2 MySQL databases into Neo4j using APOC

Hi,
I want to upload 2 different MySQL databases into one neo4j db using APOC, how should I get started? Please keep in mind I do not want to use fabric to query across multiple neo4j instances, for purposes of visualizing the whole db for the project I'm working on.
Thank you,
Christopher

1 Like

There is an post on it here:

But a short answer is download the jar connector file from here:
https://dev.mysql.com/downloads/connector/j/

Add it to the Neo4j dbmss-*****/plugins directory. Restart database.

Run this to list all tables in the database dbname:

call apoc.load.jdbc("jdbc:mysql://localhost:3306/dbname?user=dbuser&password=dbpassword",
"SELECT table_name,TABLE_ROWS 
     FROM INFORMATION_SCHEMA.TABLES 
     WHERE TABLE_SCHEMA = 'dbname'")

yield row
with row,toInteger(row.TABLE_ROWS) as antal
where antal>0
return row

Hi,
Thanks for the response. It looks like this is how to get started on one -> one import. Which is great. Will I be able to simply do that twice to get both of the 2 different MySQL databases into a neo4j db?

Yes you can.
However this simple aproach does not consider the relationships.
If you want them automated as well you could try the ETL tool for Neo4j.

In ETL Tool when I try to import 2 db's at once it only lets me import one at a time. (Please see picture attached)
Do you mean to import them sequentially? So import one first, then go back and import the other?

Haven't used Etl myself yet.
But if it is possible to run them sequentially. I don't see it as a problem.
If performance is a problem. Then you have to find away to run them in parallell threads.
Maybe with another tool.
Not sure how big the boost will be though.

Hi

You can write stored procedures in Sql server and invoke them in Cypher query language.Please refer cypher card for more details.
I guess that would be better in my opinion

Thanking you
Sameer Gijare