当前位置:   article > 正文

Ubuntu安装Neo4j

Ubuntu安装Neo4j

 Ubuntu(在线版)

更新软件源

sudo apt-get update

 添加Neo4j官方存储库

wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -

将地址添加到系统的软件包源列表中

echo 'deb https://debian.neo4j.com stable latest' | sudo tee -a /etc/apt/sources.list.d/neo4j.list

更新软件源

sudo apt-get update

安装 Neo4j

注:本文章安装neo4j 5.18.1

sudo apt install neo4j=1:5.18.1

启动Neo4j

sudo neo4j start

出现以下信息即启动成功

  1. Directories in use:
  2. home: /var/lib/neo4j
  3. config: /etc/neo4j
  4. logs: /var/log/neo4j
  5. plugins: /var/lib/neo4j/plugins
  6. import: /var/lib/neo4j/import
  7. data: /var/lib/neo4j/data
  8. certificates: /var/lib/neo4j/certificates
  9. licenses: /var/lib/neo4j/licenses
  10. run: /var/lib/neo4j/run
  11. Starting Neo4j.
  12. Started neo4j (pid:13261). It is available at http://localhost:7474
  13. There may be a short delay until the server is ready.

Ubuntu(离线版)

进入下载链接选择Neo4j版本下载

https://neo4j.com/deployment-center/

注:本文章下载neo4j-community-5.18.1-unix.tar.gz

解压文件到指定目录

tar -xvf neo4j-community-5.18.1-unix.tar.gz -C /usr/local

进入解压后的目录

cd /usr/local/neo4j-community-5.18.1/

启动neo4j

bin/neo4j start

可能报错:Error: JAVA_HOME is not defined correctly. We cannot execute 

报错原因是缺少jdk或者没有配置全局变量JAVA_HOME,安装或配置即可。

建议安装java 17。

出现以下信息即启动成功

  1. irectories in use:
  2. home: /usr/local/neo4j-community-5.18.1
  3. config: /usr/local/neo4j-community-5.18.1/conf
  4. logs: /usr/local/neo4j-community-5.18.1/logs
  5. plugins: /usr/local/neo4j-community-5.18.1/plugins
  6. import: /usr/local/neo4j-community-5.18.1/import
  7. data: /usr/local/neo4j-community-5.18.1/data
  8. certificates: /usr/local/neo4j-community-5.18.1/certificates
  9. licenses: /usr/local/neo4j-community-5.18.1/licenses
  10. run: /usr/local/neo4j-community-5.18.1/run
  11. Starting Neo4j.
  12. Started neo4j (pid:6588). It is available at http://localhost:7474
  13. There may be a short delay until the server is ready

设置远程连接

修改Neo4j配置文件

  1. # 在线版
  2. sudo vim /etc/neo4j/neo4j.conf
  3. # 离线版
  4. sudo vim /usr/local/neo4j-community-5.18.1/conf/neo4j.conf

 把 server.default_listen_address=0.0.0.0 注释放开,重启服务即可。

Neo4j初始化

打开浏览器,输入网址localhost:7474

默认用户名neo4j和密码neo4j

登录后需要修改密码,密码长度需要超过8个字符

修改密码成功 

 测试Neo4j

show databases; # 展示数据库

正常运行则成功。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/518838
推荐阅读
相关标签
  

闽ICP备14008679号