postgresql 重命名 Amazon RDS 主用户名
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29633635/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Rename the Amazon RDS master username
提问by Laura
Changing the password is easily done through the console. Is there any way to change the master username after creation on RDS for PostgreSQL? If so, how?
通过控制台可以轻松更改密码。在 RDS for PostgreSQL 上创建后,有没有办法更改主用户名?如果是这样,如何?
采纳答案by Valeriy Solovyov
You can't change username. You can check the following links that describe how to change master password and if Amazon adds the ability to change username you will find there:
您不能更改用户名。您可以查看以下描述如何更改主密码的链接,如果亚马逊添加了更改用户名的功能,您会在那里找到:
Try to find at AWS CLI for RDS:
尝试在AWS CLI for RDS 中查找:
modify-db-instance --db-instance-identifier <value> --master-user-password (string)
--master-user-password (string)
--master-user-password(字符串)
The new password for the DB instance master user. Can be any printable ASCII character except "/", """, or "@".
Changing this parameter does not result in an outage and the change is asynchronously applied as soon as possible. Between the time of the request and the completion of the request, the MasterUserPassword element exists in the PendingModifiedValues element of the operation response. Default: Uses existing setting
Constraints: Must be 8 to 41 alphanumeric characters (MySQL, MariaDB, and Amazon Aurora), 8 to 30 alphanumeric characters (Oracle), or 8 to 128 alphanumeric characters (SQL Server).
数据库实例主用户的新密码。可以是除 "/"、""" 或 "@" 之外的任何可打印 ASCII 字符。
更改此参数不会导致中断,并且会尽快异步应用更改。在请求的时间和请求的完成之间,MasterUserPassword 元素存在于操作响应的 PendingModifiedValues 元素中。默认值:使用现有设置
限制条件:必须是 8 到 41 个字母数字字符(MySQL、MariaDB 和 Amazon Aurora)、8 到 30 个字母数字字符 (Oracle) 或 8 到 128 个字母数字字符 (SQL Server)。
The Amazon RDS Command Line Interface (CLI) has been deprecated. Instead, use the AWS CLI for RDS.
Amazon RDS 命令行界面 (CLI) 已被弃用。相反,请使用适用于 RDS 的 AWS CLI。
Via the AWS Management Console, choose the instance you need to reset the password for, click ‘Modify' then choose a new master password.
通过AWS 管理控制台,选择您需要为其重置密码的实例,点击“修改”,然后选择一个新的主密码。
If you don't want to use the AWS Console, you can use the rds-modify-db-instance command (as per Amazon's documentation for RDS) to reset it directly, given the AWS command line tools: rds-modify-db-instance instance-name --master-user-password examplepassword
如果您不想使用 AWS 控制台,您可以使用 rds-modify-db-instance 命令(根据 Amazon 的 RDS 文档)直接重置它,给定 AWS 命令行工具:rds-modify-db-实例实例名 --master-user-password 实例密码
回答by funny_head
No. As of April 2019 one cannot reset the 'master username'.
不可以。截至 2019 年 4 月,无法重置“主用户名”。
回答by Thomas Hunziker
You cannot do it directly. However you can use the database migration service from AWS:
你不能直接这样做。但是,您可以使用 AWS 的数据库迁移服务:
Essentially you define the current database instance as your source and the new database with the correct username as your target of the migration.
本质上,您将当前数据库实例定义为源,并将具有正确用户名的新数据库定义为迁移目标。
This way you migrate the data from one to another database instance. As such you can change all properties including the username.
通过这种方式,您可以将数据从一个数据库实例迁移到另一个数据库实例。因此,您可以更改包括用户名在内的所有属性。
This approach has some drawbacks:
这种方法有一些缺点:
- You need to configure the migration. Which takes a bit of time.
- The data is migrated. This may lead unexpected behavior since not everything is eventually migrated (e.g. views etc.)
- It depends how you setup everything you may experience a downtime.
- 您需要配置迁移。这需要一些时间。
- 数据被迁移。这可能会导致意外行为,因为并非所有内容最终都会迁移(例如视图等)
- 这取决于您如何设置可能遇到停机的所有内容。