postgresql selected, no connection error [!] - Metasploit - Hacker Tune

Latest

Stay updated with bleeding edge technology

Monday 13 November 2017

postgresql selected, no connection error [!] - Metasploit



Solved: [!] postgresql selected, no connection error [!]




Simply just follow this steps

$ sudo msfconsol
msf > msfdb start
[*] exec: msfdb start
msf > db_status
[*] postgresql selected, no connection

msf > msfdb init

[*] exec: msfdb init
Creating database user ‘msf’
Enter password for new role:
Enter it again:
Creating databases ‘msf’ and ‘msf_test’
Creating configuration file in /usr/share/metasploit-framework/config/database.yml
Creating initial database schema

msf > db_status

[*] postgresql selected, no connection

msf > db_connect -y /usr/share/metasploit-framework/config/database.yml

[*] Rebuilding the module cache in the background…

msf > db_status

[*] postgresql connected to msf

You Are Done!!!

8 comments:

  1. Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. PostgreSQL NULL value

    ReplyDelete
  2. Didnt work, it says this:-

    db_status
    [*] postgresql selected, no connection
    msf5 > msfdb init
    [*] exec: msfdb init

    Metasploit running on Kali Linux as root, using system database
    A database appears to be already configured, skipping initialization
    msf5 > db_connect -y /usr/share/metasploit-framework/config/database.yml
    Connected to the database specified in the YAML file.
    msf5 > db_status
    [*] postgresql selected, no connection

    ReplyDelete
    Replies
    1. Try to run it with your normal account(user), not root account

      Delete
  3. Replies
    1. Try to run it with your normal account(user), not root account

      Delete
  4. Check if Postgresql is not staying started. Check /var/log/postgres/ for perms error on the below file and change the perms if you are running as root:
    chmod 0640 /etc/ssl/private/ssl-cert-snakeoil.key
    systemctl start postgresql
    Check postgres logs again for no errors...
    Continue on to msfconsole.

    ReplyDelete