Answers for "psql password not working"

0

postgres users can login with any or no password

#Find the right pg_hba.conf file.

sudo -u postgres psql
openproject_dev=# SHOW hba_file ;
              hba_file               
-------------------------------------
 /usr/local/var/postgres/pg_hba.conf
(1 row)

# Edit the file to force password login ... Leave admin (superuser) as trust. I used md5 instead of password .. password worked as well.
sudo nano /usr/local/var/postgres/pg_hba.conf

# "local" is for Unix domain socket connections only
local   all             admin                                   trust
local   all             all                                     md5
# IPv4 local connections:
host    all             admin           127.0.0.1/32            trust
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             admin           ::1/128                 trust
host    all             all             ::1/128                 md5
Posted by: Guest on October-20-2021
0

access postgres psql database password error

# MacOS Terminal Error: Using Sudo & Su Sorry!

# You may be trying to perform administrative tasks from the macOS (Mojave or later) terminal, for instance, if you are developing locally (on a Mac, of course).
# You may encounter permissions issues using your local administrative user.
# You may attempt to use the following command:

   sudo

# But unfortunately, this is unlikely to work, as the root user is disabled by default in macOS.
# You may also try to get around this by prefixing the popular 'su' command to your command, only to be greeted by an irritating 'Sorry!'
# Don't worry, you can get around this quite easily.
# Here's the solution:

   sudo su

# When the password prompt appears, simply enter the login password for your macOS account.
# From now on, you can perform root-user-level tasks without having to use 'su'.
# And you won't have to re-enter that pesky password.
Posted by: Guest on January-13-2022

Code answers related to "psql password not working"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language