1, a remote Linux server configuration environment:
(1) installation package
# python环境:
python3.6.8
py2neo==3.1.2
# neo4j环境
neo4j==3.5.6
(2) neo4j Configuration
vim conf/neo4j.conf;
# 检查配置文件
dbms.connectors.default_listen_address=0.0.0.0#远程访问
dbms.connector.bolt.enabled=true #bolt服务,默认端口7687
dbms.connector.http.enabled=true #http服务,默认端口7474
dbms.connector.https.enabled=true #https服务,默认端口7473
# 注意如果要修改服务端口,只修改bolt和https即可
例如:
只修改一下内容:后面的端口号自己设置,顺便我服务器的端口映射为9008:10125, 9009:10126
dbms.connector.bolt.listen_address=0.0.0.0:9009
dbms.connector.http.listen_address=0.0.0.0:9008
(3) Local pyneo visit:
class Neo4j(object):
def __init__(self):
# 注意这儿要用user="", password="",而不用author=(),可能是版本问题吧 ,都试试
self.graph = Graph(host='0.0.0.0', http_port=9008, bolt_port=9009, user="neo4j",password="123456")
# 底层剖析(位置:py2neo/database/__init__)
The full set of `settings` supported are:
============== ============================================= ============== =============
Keyword Description Type(s) Default
============== ============================================= ============== =============
``bolt`` Use Bolt* protocol (`None` means autodetect) bool, ``None`` ``None``
``secure`` Use a secure connection (Bolt/TLS + HTTPS) bool ``False``
``host`` Database server host name str ``'localhost'``
``http_port`` Port for HTTP traffic int ``7474``
``https_port`` Port for HTTPS traffic int ``7473``
``bolt_port`` Port for Bolt traffic int ``7687``
``user`` User to authenticate as str ``'neo4j'``
``password`` Password to use for authentication str `no default`
============== ============================================= ============== =============
(4) Remote access (note that the port call, use the URL http port, log in using bolt port, remember to modify ah)