neo4j / cypher-shell

Cypher Shell has moved to https://github.com/neo4j/neo4j
Other
89 stars 48 forks source link

Having trouble with LOAD CSV in cypher-shell with file:// path? #76

Closed cmdcolin closed 7 years ago

cmdcolin commented 7 years ago

I was just loading cypher-shell and it ended up failing

$ cypher-shell 
Connected to Neo4j 3.1.1 at bolt://localhost:7687 as user neo4j.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
neo4j> LOAD CSV WITH HEADERS FROM "file:///Users/name/data.csv" AS line CREATE (:Orthogroup {name:line.name});
Couldn't load the external resource at: file:/usr/local/Cellar/neo4j/3.1.1/libexec/import/Users/name/data.csv

The neo4j is 3.1.1 and installed with Homebrew. I was wondering if it is expecting all resources to be in this import folder or if there is a workaround?

mneedham commented 7 years ago

Yeh it assumes your CSV files are in /usr/local/Cellar/neo4j/3.1.1/libexec/import in this case.

If you want to allow loading CSV files from anywhere you need to comment this line:

# This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or uncomment it to
# allow files to be loaded from anywhere in filesystem; this introduces possible security problems. See the `LOAD CSV`
# section of the manual for details.
dbms.directories.import=import
cmdcolin commented 7 years ago

Gotcha. As long as it's with good reason. I wanted to develop loaders by loading from filesystem, but if there are security issues, I may just move to setting up a temporary localhost server

cmdcolin commented 7 years ago

I suppose close for now!