Hello I'm trying to create a database for metasploit v3. When I run db_connect root@127.0.0.1/metasploitdb I the output is:
Code:
[-] Error while running command db_connect: Failed to connect to the database: could not connect to server: Connection refused
        Is the server running on host "127.0.0.1" and accepting
        TCP/IP connections on port 5432?


Call stack:
/opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1573:in `db_connect_postgresql'
/opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1241:in `send'
/opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1241:in `cmd_db_connect'
/opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:246:in `send'
/opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:246:in `run_command'
/opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:208:in `run_single'
/opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:202:in `each'
/opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:202:in `run_single'
/opt/metasploit3/msf3/lib/rex/ui/text/shell.rb:141:in `run'
./msfconsole:112
I've created a database called metasploitdb in my home directory using postgresql also, but when I try to start the server it says
Code:
erver starting
FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": No such file or directory
What can I do to get this to work?