使用VSCode远程连接服务器并解决Neo4j无法登陆问题

摘要:本文介绍了如何通过VSCode连接内网部署的Neo4j服务器,并启动服务。在访问Neo4j登录界面时,遇到了端口映射问题导致无法登录。通过手动添加7687端口的映射后,成功登录Neo4j。


我在内网部署了一台服务器,并在其上运行了Neo4j图数据库。由于服务器的访问权限受限,需要通过VPN才能登录到该服务器。为了更方便地编写代码和操作Neo4j,我选择使用Visual Studio Code (VSCode) 来连接这台远程主机,并启动Neo4j服务。

如下图所示,访问 ++http://localhost:7474++ 可以进入neo4j 登陆界面,

这是因为 vscode 连接远程主机后,自动实现端口映射的能力(需要在vscode的终端运行命令才可以)。

在 vscode 界面中点击 PORTS ,就可看到端口映射,如下图所示:

但是输入账号和密码后,遇到了下述报错导致无法登陆。

报错信息是:

复制代码
ServiceUnavailable: WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket `readyState` is: 3

为了找到问题的根源,我右键点击了网页,选择了"检查"选项,并进一步点击了"Console"以查看该网站的报错信息。如下图所示,我发现7687端口访问失败是导致无法登录的主要原因。

于是给 vscode 手动添加 7687 端口的映射。

刷新网页,重新登陆,果然登陆成功。

相关推荐
檀越剑指大厂2 小时前
【Linux系列】如何在 Linux 服务器上快速获取公网
linux·服务器·php
共享家95272 小时前
linux-高级IO(上)
java·linux·服务器
HWL56793 小时前
“preinstall“: “npx only-allow pnpm“
运维·服务器·前端·javascript·vue.js
门前灯5 小时前
Linux系统之iprconfig 命令详解
linux·运维·服务器·iprconfig
忧郁的橙子.5 小时前
三、k8s 1.29 之 安装2
linux·运维·服务器
huangyuchi.6 小时前
【Linux系统】动静态库的制作
linux·运维·服务器·动态库·静态库·库的简单制作
闻不多6 小时前
用llamaindex搭建GAR遇到400
android·运维·服务器
jim写博客6 小时前
Linux进程概念(四)环境地址变量
linux·运维·服务器
189228048618 小时前
NY270NY273美光固态闪存NY277NY287
服务器·网络·数据库·科技·性能优化
谱写秋天8 小时前
Qt 5.5 的安装与配置(使用 VSCode编辑)
开发语言·vscode·qt