跳到主要内容
版本:v2.6.x

createUser()

Creates a user with credentials and an optional description.

Java
public void createUser(CreateUserReq request)

Request Syntax

Java
CreateUserReq.builder()
.userName(userName)
.password(password)
.description(description)
.build();

BUILDER METHODS:

  • userName(String userName)

    The name of the user account.

  • password(String password)

    The initial password for the user account.

  • description(String description)

    The human-readable description of the user account.

EXCEPTIONS:

  • MilvusClientExceptions

    Raised when any error occurs during this operation. Inspect the exception message for the exact failure reason.

Example

Creates a user with credentials and an optional description.

Java
client.createUser(CreateUserReq.builder()
.userName("alice")
.password("Milvus-Password-123")
.description("Analytics user")
.build());