step1:登錄postgresql創(chuàng)建用戶名,密碼固额,數(shù)據(jù)庫
sudo -u postgres psql ? ?//登錄postgresql
create user"msf123" with password'msf123' nocreatedb; ? ? ? ? ?//創(chuàng)建用戶名msf123十偶,密碼msf123
create database "msf123" with owner="msf123"; ? ? ? ? //創(chuàng)建數(shù)據(jù)庫為msf123
\q ? ? ? ? ? //退出
step2:啟動metasploit后連接數(shù)據(jù)庫postgresql
msfconsole ? ? ? ? ? //啟動metasploit
db_connect msf123:msf123@127.0.0.1/msf123 ? //連接數(shù)據(jù)庫
db_status ? ? ? ? ? ? ?//查看連接狀態(tài)涵叮,如果connected即連接成功