【问题标题】:Neo4j create new admin user from consoleNeo4j 从控制台创建新的管理员用户
【发布时间】:2017-12-07 14:05:02
【问题描述】:

有没有办法从控制台添加 neo4j 管理员用户? 我找到了如何更改本地用户 neo4j https://neo4j.com/docs/operations-manual/current/configuration/set-initial-password/ 的默认密码,但没有找到如何添加新的管理员用户。

【问题讨论】:

    标签: neo4j


    【解决方案1】:

    使用neo4j-admin 工具是不可能的,但可以通过运行这些查询直接使用cypher-shell(因此您需要有一个正在运行的数据库):

    CALL dbms.security.createUser('root', 'password');
    CALL dbms.security.addRoleToUser('admin', 'root');
    

    您将在此处找到所有安全程序的说明:https://neo4j.com/docs/operations-manual/current/security/authentication-authorization/native-user-role-management/procedures/

    【讨论】:

    • 可以在启动neo4j之前创建用户吗?
    • 目前无法使用内置工具,但您可以手动编辑文件夹data/dbms中的文件authroles
    【解决方案2】:

    由于需要在 neo4j 启动之前设置凭据,因此我使用此 comment 中的脚本手动生成了登录名和密码,并将它们插入到 neo4j 身份验证文件中。

    【讨论】:

      猜你喜欢
      • 2018-10-15
      • 2018-11-13
      • 2018-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-30
      • 2014-03-09
      相关资源
      最近更新 更多