Install PostgreSQL on Ubuntu – New user and database in 3 commands

Installing PostgreSQL is trivially easy.
You just have to use the same name for linux user, database user and the database name.

$ sudo apt-get update
$ sudo apt-get -y install postgresql
$ sudo -u postgres createdb tero
$ sudo -u postgres createuser tero

Use your own login name instead of “tero”.

$ psql

Yes, that’s all. You can now start writing SQL.

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *