Neo4j 4.0下新建数据库时出错

use*_*097 17 neo4j

我使用的是 Debian 9.9,Neo4j 的版本是 4.0。我在使用 neo4j 浏览器创建新数据库时遇到问题。我遵循的指令是这个

我尝试了以下 Cypher 命令:

create database myNewDatabase
Run Code Online (Sandbox Code Playgroud)

但是,会弹出这样的错误:

Neo.ClientError.Statement.NotSystemDatabaseError
Unsupported administration command: create database myNewDatabase
Run Code Online (Sandbox Code Playgroud)

请让我知道错误消息的含义以及如何解决。提前谢谢:-)

Jul*_*org 21

在Neo4j专业版的 v.4 (2020 年 2 月发布)中,可以轻松创建新数据库。 文档

社区版中,需要破解:

1. Edit the file  NEO4J_HOME\conf\neo4j.conf

2. Un-comment the line:  dbms.default_database=neo4j

3. Change the neo4j  to whatever database name you want for a new database.  Note: names must have between 3 and 63 characters.   For example:   dbms.default_database=mydatabase

4. Save the file

5. (If applicable) Kill the database server, and close the browser window with the Neo4j UI

6. Start the neo4j server, and open a new browser window, pointed as usual to http://localhost:7474/

7. Both the old (default) database, "neo4j" and the one you just created will show up.  However, attempting to switch between them causes an error.   If a switch is desired, repeat the above steps starting from (3)
Run Code Online (Sandbox Code Playgroud)

注意:上述步骤将mydatabase 在 NEO4J_HOME\data\databases 中创建一个名为(或您使用的任何名称)的文件夹,并将填充其内容。

我个人认为在数据库之间切换是一种基本操作,Neo4j 应该让它在社区版中易于访问!


use*_*097 7

我想我已经找到了问题的答案。事实证明,我的许可证(社区版)不支持使用多个数据库。另一种选择可能是这样的

  • 仅供参考,我发现在 Neo4j 4.0 中,dbms.active_database 已从 neo4j.conf 中删除。这意味着替代方案不再有效。 (2认同)
  • 我在安装 neo4j 时注意到了同样的情况;在您的conf文件中取消注释并将默认数据库名称参数更改为您想要的任何名称,这会添加一个新数据库 (2认同)