Lau*_*ura 22 postgresql amazon-web-services amazon-rds
通过控制台可以轻松更改密码.有没有办法在RDS上为PostgreSQL创建后更改主用户名?如果是这样,怎么样?
您不能更改用户名。您可以检查以下链接,这些链接描述了如何更改主密码,并且如果Amazon添加了更改用户名的功能,您将在此处找到:
尝试找到适用于RDS的AWS CLI:
modify-db-instance --db-instance-identifier <value> --master-user-password (string)
Run Code Online (Sandbox Code Playgroud)
--master-user-password(字符串)
数据库实例主用户的新密码。可以是除“ /”,“””或“ @”以外的任何可打印ASCII字符。
更改此参数不会导致中断,并且更改将尽快异步应用。在请求时间到请求完成之间,MasterUserPassword元素存在于操作响应的PendingModifiedValues元素中。默认值:使用现有设置
约束:必须为8到41个字母数字字符(MySQL,MariaDB和Amazon Aurora),8到30个字母数字字符(Oracle)或8到128个字母数字字符(SQL Server)。
不推荐使用Amazon RDS命令行界面(CLI)。而是使用AWS CLI for RDS。
通过AWS管理控制台,选择您需要为其重置密码的实例,单击“修改”,然后选择一个新的主密码。
如果您不想使用AWS控制台,则可以使用rds-modify-db-instance命令(根据Amazon RDS文档)直接重置它,并使用AWS命令行工具:rds-modify-db- instance instance-name --master-user-password examplepassword
You cannot do it directly. However you can use the database migration service from 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.
通过这种方式,您可以将数据从一个数据库实例迁移到另一个数据库实例。因此,您可以更改包括用户名在内的所有属性。
这种方法有一些缺点:
| 归档时间: |
|
| 查看次数: |
13355 次 |
| 最近记录: |