How to create a user in PostgreSQL
2008-01-05 22:56
465 查看
I had try to use the Windows Version of PostgreSQL. But I found that version of postgresql was not as friendly to users as the Windows Version of MySQL. In my point, maybe the reason why is that PostgreSQL use something that does work under Linux, but not under Windows. For example, when i use an account which is same as the account i login windows for starting/stoping the PostgreSQL service in the installition, there world be a permission error. And the installision then failed. All would rollbacked. I had to use the default configure to install PostgreSQL in Windows to avoid some unnessesary problem. Anyway, I just wanna learn and use PostgreSQL. It's fine if it can work.
hehe, let's see how to create a user in PostgreSQL. It's easy.
we login the psql, and use this command:
create user andrewleung with createdb password '123456';
now, we have create a user which name 'andrewleung' with the password 123456 and the permission of create database. if we wanna cancel the permission of create database, we can use this command:
alter user andrewleung no createdb;
The complete syntax for the CREATE USER command is
hehe, let's see how to create a user in PostgreSQL. It's easy.
we login the psql, and use this command:
create user andrewleung with createdb password '123456';
now, we have create a user which name 'andrewleung' with the password 123456 and the permission of create database. if we wanna cancel the permission of create database, we can use this command:
alter user andrewleung no createdb;
The complete syntax for the CREATE USER command is
CREATE USER user-name [[WITH] option ]... option := SYSID user-id-number | [NO]CREATEDB | [NO]CREATEUSER | IN GROUP groupname [, ...] | [[UN]ENCRYPTED ] PASSWORD 'password' | VALID UNTIL 'expiration'
相关文章推荐
- How To Create a New User and Grant Permissions in MySQL
- How To Create a New User and Grant Permissions in MySQL
- How to create a read-only user in TFS source control
- How to create a read-only user in TFS source control
- How to create a read-only user in TFS source control
- How to create user defined properties in Maven
- How to create a read-only user in TFS source control
- How To Create a New User and Grant Permissions in MySQL
- How to create custom html helper in Asp.net MVC 3 or 4
- How to create columns like "bigint" or "longtext" in Rails migrations
- How to create a new Pull Request (PR) in Github
- How to create a Gantt chart in SharePoint
- How to hide the create button dynamical tree view in openerp ?
- How to create a GoldenGate uni-directional target database in a production database zero downtime
- How to create ftp user on Linux
- [转]How to Create Custom Filters in AngularJs
- How to create an Excel sheet or chart in VC?
- How to Create a Debug File in Shipping Execution [ID 290432.1]
- How to create a secured and locked folder in XP
- How to use an ActiveX script task to create a loop in DTS