error in metasploit when creating a db
Code:
msf > db_connect root@password
[-] 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/framework3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:2028:in `db_connect_postgresql'
/opt/framework3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1731:in `cmd_db_connect'
/opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:331:in `run_command'
/opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:293:in `block in run_single'
/opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:287:in `each'
/opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:287:in `run_single'
/opt/framework3/msf3/lib/rex/ui/text/shell.rb:143:in `run'
/opt/framework3/msf3/msfconsole:130:in `<main>'
msf > Interrupt: use the 'exit' command to quit


Fast-Track bugs
Code:
Metasploit Autopwn Automation:

    http://www.metasploit.com

    This tool specifically piggy backs some commands from the Metasploit 
    Framework and does not modify the Metasploit Framework in any way. This 
    is simply to automate some tasks from the autopwn feature already developed 
    by the Metasploit crew.

    Simple, enter the IP ranges like you would in NMap i.e. 192.168.1.-254 
    or 192.168.1.1/24 or whatever you want and it'll run against those hosts. 
    Additionally you can place NMAP commands within the autopwn ip ranges bar, 
    for example, if you want to scan even if a host "appears down" just do 
    -PN 192.168.1.1-254 or whatever...you can use all NMap syntaxes in the 
    Autopwn IP Ranges portion.

    When it has completed exploiting simply type this:
  
    sessions -l (lists the shells spawned)
    sessions -i <id> (jumps you into the sessions)

    Example 1: -PN 192.168.1.1
    Example 2: 192.168.1.1-254
    Example 3: -P0 -v -A 192.168.1.1
    Example 4: 192.168.1.1/24

         Enter the IP ranges to autopwn or (q)uit FastTrack: 127.0.0.1

    Do you want to do a bind or reverse payload?

    Bind = direct connection to the server
    Reverse = connection originates from server

    1. Bind
    2. Reverse

    Enter number: 2
    Launching MSFConsole and prepping autopwn...
db_driver sqlite3
db_destroy pentest
db_create pentest
db_nmap 127.0.0.1 
db_autopwn -p -t -e -r
sleep 5
jobs -K




sessions -l
echo "If it states No sessions, then you were unsuccessful. Simply type sessions -i <id> to jump into a shell"

                __.                       .__.        .__. __.
  _____   _____/  |______    ____________ |  |   ____ |__|/  |_
 /     \_/ __ \   __\__  \  /  ___/\____ \|  |  /  _ \|  \   __\
|  Y Y  \  ___/|  |  / __ \_\___ \ |  |_> >  |_(  <_> )  ||  |
|__|_|  /\___  >__| (____  /____  >|   __/|____/\____/|__||__|
      \/     \/          \/     \/ |__|


       =[ metasploit v3.7.1-release [core:3.7 api:1.0]
+ -- --=[ 687 exploits - 357 auxiliary - 39 post
+ -- --=[ 217 payloads - 27 encoders - 8 nops
       =[ svn r12641 updated today (2011.05.16)

msf > db_driver sqlite3
[-] Invalid driver specified
msf > db_destroy pentest
[-] No database driver has been specified
msf > db_create pentest
[-] No database driver has been specified
msf > db_nmap 127.0.0.1 
[-] Database not connected
msf > db_autopwn -p -t -e -r
[-] Database not connected
msf > sleep 5
msf > jobs -K
Stopping all jobs...
msf > 
msf > 
msf > 
msf > 
msf > sessions -l

Active sessions
===============

No active sessions.

msf > echo "If it states No sessions, then you were unsuccessful. Simply type sessions -i <id> to jump into a shell"[*] exec: echo "If it states No sessions, then you were unsuccessful. Simply type sessions -i <id> to jump into a shell"

If it states No sessions, then you were unsuccessful. Simply type sessions -i <id> to jump into a shell