Cypher Neo4j Couldn't load the external resource

前端 未结 15 1723
谎友^
谎友^ 2021-02-07 05:09

In a Windows environment, I\'m trying to load a .csv file with statement:

LOAD CSV WITH HEADERS FROM \"file:///E:/Neo4j/customers.csv\" AS row

15条回答
  •  情深已故
    2021-02-07 05:41

    On (Arch) Linux + neo4j-community-3.4.0-alpha09, edit $NEO4J_HOME/conf /neo4j.conf:

    • uncomment or add: dbms.security.allow_csv_import_from_file_urls=true
    • comment: #dbms.directories.import=import

    Restart neo4j (in terminal: neo4j restart), and reload the Neo4j Browser (http://localhost:7474/browser/) if you are using a web browser as your Neo4j interface/GUI.

    Then, you should be able to load a csv from outside your $NEO4J_HOME/... directory

    E.g.,

    LOAD CSV WITH HEADERS FROM "file:///mnt/Vancouver/Programming/data/metabolism/practice/a.csv" AS ...

    where my $NEO4J_HOME/ is /mnt/Vancouver/apps/neo4j/neo4j-community-3.4.0-alpha09/

    LOAD CSV WITH HEADERS FROM "file:/mnt/Vancouver/Programming/data/metabolism/practice/a.csv" AS ...

    also works, but not

    LOAD CSV WITH HEADERS FROM "file://mnt/Vancouver/Programming/data/metabolism/practice/a.csv" AS...

    or

    LOAD CSV WITH HEADERS FROM "/mnt/Vancouver/Programming/data/metabolism/practice/a.csv" AS...

    i.e. use ...file:/... or ...file:///...

提交回复
热议问题