You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

本地Windows环境下Neo4j执行LOAD CSV查询遇WebSocket连接失败求助

解决Neo4j LOAD CSV时的WebSocket连接失败问题

Hey there, let's troubleshoot that WebSocket connection failure you're facing when running your LOAD CSV query on Windows. I’ve dealt with this exact issue a few times, so here are the most reliable fixes to try out:

  • 确认Neo4j服务正在运行
    First things first: make sure your Neo4j database instance is up and running. If you’re using Neo4j Desktop, check that your database card shows "Running" at the top. If you're using the command line, navigate to your Neo4j installation's bin folder and run:

    neo4j.bat status
    

    If it’s not running, start it with:

    neo4j.bat start
    

    Or just hit the "Start" button in Neo4j Desktop if that’s your setup.

  • 检查CSV文件的位置与权限
    Your query uses file:///Test.csv, which means Neo4j expects the file in its dedicated import directory. On Windows, this is usually:

    • For Neo4j Desktop: C:\Users\<YourUsername>\.neo4j\import
    • For a standalone installation: <Neo4jInstallDir>\import
      Move your Test.csv into this folder to avoid path-related errors. Also, right-click the file, go to Properties > Security, and make sure the user running Neo4j (or your Windows account) has read permissions for the file.
  • 调整Neo4j的网络配置
    WebSocket issues often tie back to Neo4j’s connector settings. Open your neo4j.conf file (found in your Neo4j installation's conf folder) and verify these parameters:

    • dbms.connector.bolt.enabled=true:确保驱动WebSocket连接的Bolt连接器处于开启状态。
    • dbms.connector.bolt.listen_address=:7687:检查7687端口是否被其他程序占用,在命令提示符中运行以下命令查看:
      netstat -ano | findstr :7687
      
      如果端口被占用,要么关闭占用端口的程序,要么将监听地址改为其他端口(比如:7688),之后重启Neo4j服务生效。
    • 如果你处于测试环境,可以临时设置dbms.security.auth_enabled=false来排除认证问题(记得生产环境要重新开启!)。
  • 排除客户端/浏览器干扰
    如果你在Neo4j Browser中运行查询,试试刷新页面或者切换到其他浏览器(比如从Edge换成Chrome)。浏览器扩展或缓存数据有时会阻断WebSocket连接。另外,要确认Neo4j Browser中的连接URL和你的Bolt设置匹配(默认是bolt://localhost:7687)。

  • 先用简单测试排查问题
    运行一个基础查询,看看WebSocket问题是否只出现在LOAD CSV上:

    CREATE (test:TestNode {id: 1, name: "Test"})
    

    如果这个查询也抛出同样的错误,说明问题出在基础连接上,和CSV导入无关;如果查询正常,那可能是你的CSV文件有问题(比如格式错误、编码异常或者数据量过大导致超时)。可以先把CSV精简到2-3行再测试,缩小问题范围。

内容的提问来源于stack exchange,提问作者Zehra Ansari

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 06:17:01