针对kali的Metasploit连接不上数据库的报错

2018-11-30  本文已影响0人  黑小柴

如有如下报错:

Failed to connect to the database: FATAL: password authentication failed for user "msf"
FATAL: password authentication failed for user "msf"

或者

Failed to connect to the database: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5433?

/usr/share/metasploit-framework/config目录中运行以下指令:

root@kali:/usr/share/metasploit-framework/config# msfdb reinit
root@kali:/usr/share/metasploit-framework/config# cp database.yml /root/.msf4/
root@kali:/usr/share/metasploit-framework/config# service postgresql restart
root@kali:/usr/share/metasploit-framework/config# msfconsole

即可

出现
Module database cache not built yet, using slow search
msfdb init
msf > db_rebuild_cache
即可

上一篇下一篇

猜你喜欢

热点阅读