Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6107

Even an IA can help me! PostgreSQL in Ubuntu, can't access due to an old deleted user [duplicate]

$
0
0

Hi everyone and thanks in advance.I'm studing WebDevelopment and i tried to connect a database (postgresql) to a node using express to create my first and simple app.I have installed the latest version of Node (20.11.0) without any issues. I installed PostgreSQL following the official documentation from their website, and pgAdmin4:

Create the file repository configuration:sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

Import the repository signing key:wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Update the package lists:sudo apt-get update

Install the latest version of PostgreSQL.If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':sudo apt-get -y install postgresql

When an error regarding a deprecated key appeared in the console, I consulted Google Gemini to resolve the issue, but all it did was install and uninstall things repeatedly in a loop.In summary: After trying to uninstall PostgreSQL, pgAdmin4, along with all their files and configurations, reinstalling PostgreSQL and pgAdmin again, I can access it via the Ubuntu app and web, but if I try to access it through the console, I get the following error:console error

That user "ocp2k" is a user with a password that I created in a previous installation and deleted before uninstalling and reinstalling PostgreSQL. I have tried to delete and recreate the same user, but it is impossible.I tried this following chatgpt and staackoverflow search:

sudo -u postgres -ipostgresql@ocp2k-MS-7978:~$//Its works aparently
sudo -u postgres psqlpsql (16.2 (Ubuntu 16.2-1.pgdg23.10+1))Digite «help» para obtener ayuda.postgres=# \du                               Lista de roles Nombre de rol |                         Atributos                          ---------------+------------------------------------------------------------ postgres      | Superusuario, Crear rol, Crear BD, Replicación, Ignora RLSpostgres=# \q
psql -h localhost -U postgresContraseña para usuario postgres: psql: error: falló la conexión al servidor en «localhost» (127.0.0.1), puerto 5432: FATAL:  la autentificación password falló para el usuario «postgres»falló la conexión al servidor en «localhost» (127.0.0.1), puerto 5432: FATAL:  la autentificación password falló para el usuario «postgres»
psql postgres                                                                                 psql: error: falló la conexión al servidor en el socket «/var/run/postgresql/.s.PGSQL.5432»: FATAL:  no existe el rol «ocp2k»//then i can't do this:postgres=# CREATE ROLE username superuser;postgres=# ALTER ROLE username WITH LOGIN;
dump - pg_dump --no-owner --no-privileges --format=c --dbname=postgres://userpass:username@postgres:5432/schemaname > /tmp/full.dumpdump: invalid option -- '-'dump 0.4b47 (using libext2fs 1.47.0 of 5-Feb-2023)usage:  dump [-level#] [-acmMnqSuv] [-A file] [-B records] [-b blocksize]         [-d density] [-D file] [-e inode#,inode#,...] [-E file]         [-f file] [-h level] [-I nr errors] [-j zlevel] [-Q file]         [-s feet] [-T date] [-y] [-z zlevel] filesystem    dump [-W | -w]

I have been searching for documentation, asking ChatGPT, Gemini, Phind, and it keeps making me uninstall and reinstall in a loop without solving the problem.I want to delete that "ocp2k" deleted user and I want to set the PostgreSQL user as the only default user when trying to enter through psql.


Viewing all articles
Browse latest Browse all 6107

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>