在 DB2 中使用 DDL 创建数据库用户

Create database user with DDL in DB2

我正在尝试在 DB2 中使用 DDL 创建用户。我试过这个:

CREATE USER 'test_user' IDENTIFIED BY 'password';

我收到了这条错误消息:

An unexpected token "'test_user' 
IDENTIFIED BY 'password'" was found following "CREATE USER ".  Expected tokens may include:  "<space>".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.24.92

当我删除撇号时:

CREATE USER test_user IDENTIFIED BY password

我明白了:

An unexpected token "USER" was found following "CREATE ".  Expected tokens may include:  "VARIABLE".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.24.92

我有完全的管理员权限,我是 运行 云上的 DB2 仓库 Type:Enterprise 计划 - 单节点

当您查看 SQL statements supported by Db2 Warehouse on Cloud 时,您会注意到没有 CREATE USER 语句。因此出现错误消息。

查看 section on user management or see the API to create a new user