Skip to main content

Postgres Automatically Creates the Wrong Username

Comments

5 comments

  • cPanelMichael
    Hello, Could you elaborate on how you are creating the PostgreSQL databases? You should create the databases through cPanel, create the user through cPanel, and then add the user to the database the same way you would for MySQL. Thank you.
    0
  • Mic1
    Hello, Could you elaborate on how you are creating the PostgreSQL databases? You should create the databases through cPanel, create the user through cPanel, and then add the user to the database the same way you would for MySQL. Thank you.

    I'll give an example: In cPanel I go to PostgreSQL Databases and create a database name myuser_mydb At which point, via cli, I log into postgres and run a command to list all my databases/users: \l This shows: Name | Owner | Encoding | Collation | Ctype | Access privileges ----------------------------+-----------------+-----------+-------------+-------------+---------------------------------------myuser_mydb | myuser_mydb | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/myuser_mydb : myuser_mydb=CTc/myuser_mydb I have not yet created a user for this database, but it creates one automatically. I *can* create a user and assign it if I want, but phpPgAdmin uses the username 'myuser' to list the databases contained therein. So, by default, the username 'myuser' should be assigned to all phpPgAdmin databases and then, from there, I can create custom users, like myuser_pguser and add them, then a \l would show that user. To summarize, in order for phpPgAdmin to display all of my databases, I need all of them to have the owner 'myuser', which was default behavior. But now the owner is 'myuser_mydb'. I can go into the psql command-line and change the owner to 'myuser' which then causes it to show up in phpPgAdmin, but I want them to be created that way from the get-go as they once were.
    0
  • cPanelMichael
    Hello, Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome. Thank you.
    0
  • Mic1
    Ticket #6377373
    0
  • cPanelMichael
    To update, reinstalling PostgreSQL through "/scripts/installpostgres" addressed the issue. Thank you.
    0

Please sign in to leave a comment.