创建postgres用户
PostgreSQL Database Server have a lot of tools to manage the suite. Creating user is one of the most popular issue to manage Postgres Database. In this tutorial we will examine how to create user with different rights, privileges, database. We will mainly follow createuser
tool for these and createuser
is a wrapper for the CREATE ROLE
Sql statement. By the way we have allready examined the PostgreSQL Database Server installation in the following tutorial.
PostgreSQL数据库服务器有很多工具来管理该套件。 创建用户是管理Postgres数据库的最受欢迎的问题之一。 在本教程中,我们将研究如何创建具有不同权限,特权和数据库的用户。 我们将主要针对这些用户使用createuser
工具,而createuser
是CREATE ROLE
Sql语句的包装器。 顺便说一下,我们已经在以下教程中检查了PostgreSQL数据库服务器的安装。
How To Install PostgreSQL Server Into Linux, Debian, Ubuntu, CentOS, Mint, Fedora, Redhat?
如何在Linux,Debian,Ubuntu,CentOS,Mint,Fedora,Redhat中安装PostgreSQL服务器?
将Shell更改为Postgres用户 (Change Shell To Postgres User)
PostgreSQL Database server can be accessed with postgres
user which is created during database installation. We can use sudo
command with -i
and -u
parameters by specifying username postgres
like below.
可以使用在数据库安装期间创建的postgres
用户访问PostgreSQL数据库服务器。 通过指定如下用户名postgres
我们可以将sudo
命令与-i
和-u
参数一起使用。
$ sudo -i -u postgres