使用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 端口的映射。

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

相关推荐
搜搜秀1 小时前
find指令中使用正则表达式
linux·运维·服务器·正则表达式·bash
Archie_IT3 小时前
修图自由!自建IOPaint服务器,手机平板随时随地远程调用在线P图
运维·服务器·前端·git·深度学习·npm·conda
无名之逆3 小时前
[特殊字符] Hyperlane:为现代Web服务打造的高性能Rust文件上传解决方案
服务器·开发语言·前端·网络·后端·http·rust
请叫我飞哥@4 小时前
在 Visual Studio Code 中安装 Python 环境
ide·vscode·python
我是小木鱼5 小时前
浅析Centos7安装Oracle12数据库
linux·运维·服务器·数据库
Pluto & Ethereal6 小时前
新手宝塔部署thinkphp一步到位
运维·服务器·阿里云·php·腾讯云
lyk_dtf6 小时前
本地laravel项目【dcat-admin】部署到liunx服务器
服务器·php·laravel
wusam6 小时前
Linux系统管理与编程12: FTP服务配置
linux·运维·服务器
无极程序员7 小时前
远程主机可能不符合glibc和libstdc++ VS Code服务器的先决条件
android·java·运维·服务器·php
周Echo周7 小时前
7、linux基础操作2
linux·运维·服务器