ONgDB新建用户与修改密码

 

Here’s the table of contents:

  1. 修改默认用户的密码
  2. 创建新用户
    1. 用户创建:
    2. 查看当前用户:
    3. 查看所有用户:
    4. 删除用户:
    5. 用户角色分类

修改默认用户的密码

  • 节点在启动之后必须要先进shell修改密码,首次进入默认的用户密码都是neo4j。
    CALL dbms.changePassword('testlab%pro');
    CALL dbms.changePassword('testlab%dev');
    

    在浏览器修改密码

    :server change-password
    

创建新用户

  • 切换用户
    :server disconnect
    :server user list
    :server user add
    

    用户创建:

    CALL dbms.security.createUser(name,password,requridchangepassword)
    

    其中nam参数是你的用户名,password是密码,requridchangepassword是表示是否需要修改密码,布尔类型。如下创建一个test1用户,密码是test1,不需要修改密码。

    查看当前用户:

    CALL dbms.security.showCurrentUser()
    

    flags表示是否要修改密码,为空表示不需要。[“password_change_required”]表示需要。

    查看所有用户:

    CALL dbms.security.listUsers()
    

    删除用户:

    CALL dbms.security.deleteUser(“username”)
    

    username参数表示你要删除的用户名。

用户角色分类

|Role|Privileges| |—|—| |reader |Read-only access to the data graph (all nodes, relationships, properties)| |publisher |Read-write access to the data graph| |architect |Read-write access to data graph and set/delete access to indexes and any other future schema constructs| |admin |Read-write access to data graph and set/delete access to indexes and any other future schema constructs and view/terminate queries| |reader | can perform read-only queries on all databases except system.| |editor | can perform read and write operations on all databases except system, but cannot make new labels or relationship types.| |publisher | can do the same as editor, but also create new labels and relationship types.| |architect | can do the same as publisher as well as create and manage indexes and constraints.| |admin | can do the same as all the above, as well as manage databases, users, roles and privileges.|