DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

PostgreSQL: Create New User And Database

08.02.2009
| 8943 views |
  • submit to reddit
        Create a new user in PostgreSQL, then add a new database as that owner.  

$ sudo -u postgres createuser -D -A -P mynewuser
$ sudo -u postgres createdb -O mynewuser mydatabase 

Reference: 
<a href="http://www.ubuntugeek.com/howto-setup-database-server-with-postgresql-and-pgadmin3.html">How to Setup a Database Server with PostgreSQL</a>