IIC2513-2022 / syllabus-2

Repositorio oficial de la sección 2 del periodo 2022-1 del curso PUC IIC2513 Tecnologías y Aplicaciones Web
33 stars 4 forks source link

[Tengo un error] psql Mac #3

Open mt-garcia opened 2 years ago

mt-garcia commented 2 years ago

Hola! Que he tenido muchos problemas para poder crear la base de datos. Al intentar usar psql me tiraba el siguiente error: psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket?

Buscando en internet (https://dba.stackexchange.com/questions/75214/postgresql-not-running-on-mac) llegué a que debía correr un código para cambiar la configuración de psql:

$ brew services stop postgresql
# adjust path accordingly to your install, e.g. `/opt/homebrew/var/postgres/postmaster.pid`
$ rm /usr/local/var/postgres/postmaster.pid 
$ brew services start postgresql

Esto me funcionó a medias, porque logré cambiar la configuración pero sigue sin funcionarme psql, ya que me dice que no encuentra los comandos. ¿Qué puedo hacer?

Esto fue lo que salió en el terminal al correr el código


rm /opt/homebrew/bin/psql
brew services start postgresql
==> Tapping homebrew/services
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 1996, done.
remote: Counting objects: 100% (505/505), done.
remote: Compressing objects: 100% (169/169), done.
remote: Total 1996 (delta 342), reused 444 (delta 328), pack-reused 1491
Receiving objects: 100% (1996/1996), 547.76 KiB | 389.00 KiB/s, done.
Resolving deltas: 100% (897/897), done.
Tapped 1 command (45 files, 699.6KB).
Warning: Service `postgresql` is not started.
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)```
pedroherreraj commented 2 years ago

Hola! Prueba corriendo el siguiente comando export PATH="/Applications/Postgres.app/Contents/Versions/9.5/bin:$PATH" en tu terminal. Cambia el número 9.5 por la versión que instalaste

valeeeriquelme commented 2 years ago

@mt-garcia la línea "rm /opt/homebrew/bin/psql" la corriste tu?

ian-fell commented 2 years ago

Hola! Yo no soy ayudante, pero estaba teniendo exactamente el mismo error. Revisé la misma página que mandaste, y hay una respuesta más abajo que con brew postgresql-upgrade-database funcionaba, y así se me solucionó. Podrías probar con eso.