Neo4j下执行cypher-shell时,Connection refused问题解决?

 

 

 

  不多说,直接上干货!

 

 

 问题现象

root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ls
cypher-shell  neo4j  neo4j-admin  neo4j-import  neo4j-shell  tools
root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ./neo4j start
Active database: graph.db
Directories in use:
  home:         /usr/local/app/neo4j
  config:       /usr/local/app/neo4j/conf
  logs:         /usr/local/app/neo4j/logs
  plugins:      /usr/local/app/neo4j/plugins
  import:       /usr/local/app/neo4j/import
  data:         /usr/local/app/neo4j/data
  certificates: /usr/local/app/neo4j/certificates
  run:          /usr/local/app/neo4j/run
Starting Neo4j.
WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
Started neo4j (pid 58377). It is available at http://0.0.0.0:7474/
There may be a short delay until the server is ready.
See /usr/local/app/neo4j/logs/neo4j.log for current status.
root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ./cypher-shell 
Connection refused
root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# 

 

 

 

 

 

 

 

 

问题分析

  (1)配置文件里的关于shell的配置打开了吗

    (2)为了更好的远程访问

 

 

解决办法一

# Enable a remote shell server which Neo4j Shell clients can log in to.
#dbms.shell.enabled=true
# The network interface IP the shell will listen on (use 0.0.0.0 for all interfaces).
#dbms.shell.host=127.0.0.1
# The port the shell will listen on, default is 1337.
#dbms.shell.port=1337

 

   必须启动neo4j,其实是可以不需执行bin/neo4j start的。

 

root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ls
cypher-shell  neo4j  neo4j-admin  neo4j-import  neo4j-shell  tools
root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ./cypher-shell
username: neo4j
password: ******
Connected to Neo4j 3.2.0 at bolt://localhost:7687 as user neo4j.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
neo4j>

 

 

 

 

 

解决办法二(推荐)

 

# Enable a remote shell server which Neo4j Shell clients can log in to.
dbms.shell.enabled=true
# The network interface IP the shell will listen on (use 0.0.0.0 for all interfaces).
dbms.shell.host=0.0.0.0
# The port the shell will listen on, default is 1337.
dbms.shell.port=1337

 

 

 

root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ls
cypher-shell  neo4j  neo4j-admin  neo4j-import  neo4j-shell  tools
root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ./cypher-shell
username: neo4j
password: ******
Connected to Neo4j 3.2.0 at bolt://localhost:7687 as user neo4j.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
neo4j>

   成功!

 

 

 

   退出,是如下的操作

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值