Neo4j导入CSV文件过程中,将文件放入import后运行命令:
LOAD CSV WITH HEADERS FROM "file:///shiti1.csv" AS line MERGE (p:Type{tid:toInteger(line.xuekeid),name:line.计算机科学与技术})
报错内容:
Couldn’t load the external resource at: file:/shiti1.csv ()
问题原因及解决
Windows版Neo4j的配置文件conf/neo4j.conf中默认配置了dbms.directories.import=import,所以可以将文件放入improt后使用相对路径导入
而docker版Neo4j的配置文件中没有配置dbms.directories.import参数,所以需要使用全路径导入
LOAD CSV WITH HEADERS FROM 'file:///var/lib/neo4j/import/shiti2.csv' AS line MERGE (p:Type{tid:toInteger(line.xuekeid),name:line.计算机科学与技术})
或者在conf/neo4j.conf中配置
dbms.directories.import
后重启