PostgreSQL Database Administration Tools

PostgreSQL Database Administration Tools

  • Create a new postgres user:
    • Open up your terminal and run: sudo -u postgres psql
    • At the prompt, type your root password and hit the “Return” key
    • Type the default “postgres” password
    • The terminal session changes to postgres=#, indicating a successful connection to the Postgres shell.
      • For Windows users, if you followed the instructions in the link from the previous video, you should be able to access the Postgres shell by now.
    • Execute the following statement to create a user called “altschool_db_user” (feel free to change the password to something of your choice, but make sure it’s something you remember easily):
      • CREATE USER altschool_db_user WITH ENCRYPTED PASSWORD ‘altschool_db_pass’;
      • This creates a “altschool_db_user” user with an encrypted password “altschool_db_pass”.
      • Create a new Postgres database:
        • CREATE DATABASE altschool_db;
        • GRANT ALL PRIVILEGES ON DATABASE altschool_db TO altschool_db_user;
      • Type exit and hit the “return” or “enter” key.
Scroll to Top