#I can't run my Phoenix Project

62 messages · Page 1 of 1 (latest)

verbal garden
#

I can't configure postgresql correctly. I've already created several users and passwords but I can't create the connection and I don't know how to do it. Here is Phoenix's error:

keen python
#

you need to give your postgres user permissions to create databases:

ALTER USER <username> CREATEDB;
verbal garden
#

how i running this command ?

keen python
#

in a psql shell: psql -U <username>

verbal garden
#

ok

keen python
#

how about psql -h localhost -U postgres?

#

how have you been creating all these postgres users?

verbal garden
#

i do no hahahhah sorry how i verify this ?

verbal garden
keen python
#

try postgres?

viral plaza
#

Post your pg_hba.conf

verbal garden
verbal garden
#

because i run cat pg_hba.conf and not running

viral plaza
#

How did you install Postgres?

#

Debian package?

verbal garden
#

using apt, but how i uninstall all the setup in linux ? To to the right steps now

verbal garden
#

i use pop os

viral plaza
#

Prolly in /etc/postgresql/pg_hba.conf but you’ll need to poke around not run random cat commands

verbal garden
#

ok man, sorry

viral plaza
#

This file controls the methods of authentication used based on the connection method and source

#

No need to be sorry bud

viral plaza
#

Try ls in the directory. You gotta find where the config files are

#

You can run pg_config it might help

verbal garden
#

ok

keen python
#

on pop-os it's in: /etc/postgresql/14/main/pg_hba.conf

verbal garden
#

thanks bro

#

I discovered that I have installed version 12, 14 and 15 of postgres, how do I uninstall them?

keen python
#

how did you install 15? that's not in the pop-os repository I don't think...

verbal garden
#

i do no, i running a lot of commands of differents websites

verbal garden
keen python
#

we can't help you figure out how to uninstall things if you don't know how you installed them... but I do suggest you try and get rid of 12 and 15 to make sure they're not interfering

verbal garden
#

I'm pretty sure I installed it using apt anyway

#

yes, i verify and that is, i use apt

keen python
#

maybe. but you may have also used snap and/or flatpak?

verbal garden
#

i think no, because i install everything in the terminal

keen python
#

snap and flatpack can also be used in the terminal, no?

verbal garden
#

yes

#

but i don't remember install flatpak or snap, i read in the history of terminal and i not find any flatpak or snap

#

at least as far as i saw

keen python
#

ok, just making sure

#

so use apt to uninstall 12 and 15

verbal garden
#

ok

#

how i specify the versions ?

keen python
#

I don't know

verbal garden
#

i will find in the internet

#

i run sudo apt-get --purge remove postgresql but when I enter the etc folder there is still the postgresql folder and the versions

#

@keen python @viral plaza

marsh fiber
#

Uninstalling usually leaves those behind (among other random files). The big deal is that other versions can run on the default port for the version you're expecting.

Have you ever been able to get Postgres working like you expect? If you were able to make users something worked but that could've been 12 then you upgraded to 14 or 15 etc.

verbal garden
#

Got it, I couldn't make it work like I expected yet @marsh fiber

marsh fiber
#

You may also need to remove each version though I don't know how popos does it. It may not be a bad idea to remove everything and start over but due to the files in /etc/postgres/... it may not revert back to a fresh install. I'd personally google how to remove those files or maybe just move them to a new place for each version. Then verify apt remove caught each version because just postgres vs postgres-12 may not get anything.

From there I'd try just apt install. There may be further commands or you may need to sudo as root. If that still doesn't work I'd look at web history to see if I could find the sites with all the commands but that's a major task. There shouldn't be some random config file outside of etc but you can run commands to probably make something like that happen.

The tl;dr is to try to uninstall everything to start from zero and focus on just version 14.

viral plaza
#

sorry I missed something, why does the version matter at all?

trail bluff
# verbal garden

Your installation setup of PostgreSQL was correct. I believe you simply needed to use peer authentication as password authentication is disabled initially.

$ sudo -u postgres psql
PSQL> ALTER USER postgres WITH PASSWORD='postgres';
verbal garden
verbal garden
verbal garden
keen python