Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2017 January PostgreSQL Error – FATAL: database role “root” does not exist in Linux

PostgreSQL Error – FATAL: database role “root” does not exist in Linux

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

A PostgreSQL Fatal error like role or username does not exist. This is a very common error which is facing by PostgreSQL Users.

Actually, this is happening because of misconfiguration of System username and Database Username.

Most of the Linux users are trying to log in PostgreSQL using root user. But actually, this is wrong.

You will need to become the operating system user under which PostgreSQL was installed to create the first user account.

Generally, the default user name is Postgres and default database is also Postgres.
Once you install PostgreSQL on Linux, you should set the password for the Postgres user which is the default super user of PostgreSQL.

Please do not try to log in with any other default Linux or Unix system user name.

Set password for the default Postgres user:

1
sudo passwd postgres

Create another role using “postgres”:
Creating new role “dbrnd”. -p = set the password and -d = allow to create database.

1
sudo -u postgres createuser dbrnd -d -P

PostgreSQL: How to Install PostgreSQL 9.4 on Ubuntu 14.04?

PostgreSQL: How to Install PostgreSQL 9.6 on Ubuntu 16.04?

Jan 23, 2017Anvesh Patel
MySQL: The ARCHIVE Storage Engine, store large amounts of unindexed DATAPostgreSQL: How to apply ACCESS EXCLUSIVE LOCK MODE on Table?
Comments: 4
  1. ladhari
    July 24, 2018 at 5:07 am

    thank you for this very useful information
    but I still face the same trouble everytime I followed the commands that you wrote but still getting the same fatal error
    i am running the database through docker …

  2. bhasha
    August 29, 2018 at 12:21 pm

    thanx

  3. Michael Dunga
    February 1, 2020 at 2:28 pm

    Thank you. It helped me a lot

    • Anvesh Patel
      Anvesh Patel
      May 27, 2020 at 12:27 pm

      Great…

Anvesh Patel
Anvesh Patel

Database Engineer

January 23, 2017 PostgreSQLAnvesh Patel, database, database research and development, dbrnd, fatal, login, login fail, permission, plpgsql, Postgres, Postgres Query, postgresql, PostgreSQL Administrator, PostgreSQL Error, PostgreSQL Programming, PostgreSQL Tips and Tricks, role, role does not exist, username
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....