我正在尝试使用我系统上的本地csv将数据加载到neo4j中:
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:/Users/jlujan/Desktop/northwind/customers.csv" AS row
CREATE (:Customer {CustomerID: row.CustomerID, CompanyName: row.CompanyName,
ContactName: row.ContactName, ContactTitle: row.ContactTitle,
Address: row.Address, City: row.City, Region: row.Region, PostalCode: row.PostalCode, Country: row.Country, Phone: row.Phone, Fax: row.Fax});
每次收到此错误:无法加载外部资源:file:/var/lib/neo4j/import/Users/jlujan/Desktop/northwind/customers.csv
我认为这是一个网址问题,但我不确定是什么。请帮忙!
答案 0 :(得分:1)
看起来你正在使用Neo4j 3?
你会在neo4j.conf
中找到像这样的设置
# 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
如果你删除它/注释它,Neo4j应该允许从系统中的任何地方加载文件