嵌入式(Embedded)Neo4j数据库访问方法

时间:2022-06-10
本文章向大家介绍嵌入式(Embedded)Neo4j数据库访问方法,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

应用中采用嵌入式Neo4j(Embedded Neo4j)数据库,插入数据后不知道如何访问。查询之后知道有Neoclipse这个可视化工具,最新版本是1.9.5。添加目录后报错:

应该是Neoclipse 1.9.5无法兼容Neo4j 2.0版本。

另辟蹊径,无意中发现如下方法,如果他人已经发过相关内容,那就对不起啦,我没有认真的去网络上搜索。

安装Neo4j server版本,安装完成之后打开应用程序,选择应用创建的数据库目录。

启动服务,访问页面:http://localhost:7474/browser/

首次登录会要求输入新密码,没关系,放心的输入新密码。

这个密码并不影响应用的使用,因为代码访问嵌入式Neo4j数据库并不用密码。

官方文档(http://neo4j.com/docs/stable/capabilities-data-security.html)中有如下描述:

Some data may need to be protected from unauthorized access (e.g., theft, modification). Neo4j does not deal with data encryption explicitly, but supports all means built into the Java programming language and the JVM to protect data by encrypting it before storing.

Furthermore, data can be easily secured by running on an encrypted datastore at the file system level. Finally, data protection should be considered in the upper layers of the surrounding system in order to prevent problems with scraping, malicious data insertion, and other threats.

可以理解为:

一些数据需要被保护以防止非法的访问(例如,窃取,篡改)。Neo4j本身并不支持处理数据加密,但是数据存储之前可以使用java代码或者JVM加密数据,而Neo4j支持所有的这种加密方式。

此外,文件系统层级上运行数据存储加密更能保证数据的安全。最后,数据保护应考虑在系统上层实现,以防止数据摩擦,恶意数据插入和其他威胁。

Neo4j官方并没有提供类似于Mysql等关系型数据库那样登录必须要账号密码,而是建议我们自己加密数据。至于server版本的,目前还没有接触,无法知道是否需要密码。

每次登陆都需要输入密码,很麻烦,可以去除密码。

点击上述界面中Options按钮,出现如下对话框:

点击编辑,在文本内容的最后输入如下内容:

#make other computer can access your neo4j database

org.neo4j.server.webserver.address=0.0.0.0(使他人的计算机能够访问你的neo4j数据库)

#diabled authorization(浏览器访问不需要密码)

dbms.security.auth_enabled=false

教程结束,感谢阅读。

欢迎转载,但请注明本文链接,谢谢。

2016-03-31   20:36:37