Indonesian Back|Track Team
Fixed Failed to Connect to the Database Metasploit - Printable Version

+- Indonesian Back|Track Team (https://www.indonesianbacktrack.or.id/forum)
+-- Forum: Attacker Zone (https://www.indonesianbacktrack.or.id/forum/forum-169.html)
+--- Forum: Exploitation (https://www.indonesianbacktrack.or.id/forum/forum-43.html)
+---- Forum: Metasploit (https://www.indonesianbacktrack.or.id/forum/forum-122.html)
+---- Thread: Fixed Failed to Connect to the Database Metasploit (/thread-5848.html)

Pages: 1 2


Failed to Connect to the Database Metasploit - Clound_Carbelius - 06-02-2014

Sblum nya mohon maaf klo repsol Big Grin
maklum ilmu ku blom tinggi \m/

oke,langsung aja
Mungkin dari beberapa orang yg baru belajar Metasploit, pernah ngalamain error database metasploit seperti ini

[Image: 1.png]
Failed to connect to the database: could not connect to server: connection refused


Udah Jelas banget dari Pesan nya, Database nya gak connected Smile
[hide]
Ok, Bgini cara Fix nya
1. Pastikan service postgresql, kalian berjalan
2. cek file config database metasploit nya ( /opt/metasploit-4.4.0/config/database.yml )


Jalankan Service Postgresql nya.
$ service postgresql start

Masih ada error ??
bisa jadi itu karna masalah config dengan dengan database msf kalian,
dan ini cara untuk setup new database msf dengan postgresql
Quote:[email protected]:# su - postgres

[email protected]~$ createuser [Nama User] -P
[email protected]~$ [Enter password]
[email protected]~$ Validate password
[email protected]~$ Shall the new role be a superuser? n
[email protected]~$ Shall the new role be allowed to create databases? n
[email protected]~$ Shall the new role be allowed to create new roles? n
[email protected]~$ createdb --owner=[Nama User] [Name_Database]
[email protected]~$ exit

setelah membuat user di posgresql

next kita membuat file configure database Metasploiut nya.
kalian bisa liat contoh file nya di
"/usr/share/metasploit-framework/config/database.yml.example"

edit aja langsung itu file example nya..

[Image: 1.png]

kemudian save
copy dan rename file tersebut Big Grin

$ sudo cp database.yml.example database.yml


Ok, Next.. Buka msfconsole

Jika masih belum connected.. coba di connect'kan langsung di metasploit console nya
msf > db_connect NamaUserTongue[email protected]:5432/name_database


Ok,Done.. :-bd
[/hide]

Postingan ini boleh di share/di perbanyak,dengan menyertai link sumber dibawah :
http://carbelius.blogspot.com/2014/06/fixed-failed-to-connect-to-database.html

ok,thank all :-bd


RE: Failed to Connect to the Database Metasploit - sonyrimawan - 06-04-2014

nice share om. kebetulan dulu ane pernah ngalamin hal yang sama waktu gagal upgrade Big Grin


RE: Failed to Connect to the Database Metasploit - dimascyber4rt - 06-05-2014

thanks bro ilmunya hehehe..... :-bd


RE: Failed to Connect to the Database Metasploit - iKONspirasi - 06-06-2014

nice share bro, +1 dari gw Big Grin

biasanya errornya ini abis update OS, kemudian metasploitnya kena update dan file database.yml-nya ketimpa.


RE: Failed to Connect to the Database Metasploit - Clound_Carbelius - 06-06-2014

(06-06-2014, 07:11 AM)iKONspirasi Wrote: nice share bro, +1 dari gw Big Grin

biasanya errornya ini abis update OS, kemudian metasploitnya kena update dan file database.yml-nya ketimpa.

iyap..bener banget om :-bd


RE: Failed to Connect to the Database Metasploit - dunkenciels - 06-07-2014

Deleted


RE: Failed to Connect to the Database Metasploit - Rvz_Venom - 06-08-2014

wah mantep nih post, ane sering gini waktu pake metasploit di ubuntu raring ane,,


RE: Failed to Connect to the Database Metasploit - Clound_Carbelius - 06-08-2014

(06-08-2014, 11:53 AM)Rvz_Venom Wrote: wah mantep nih post, ane sering gini waktu pake metasploit di ubuntu raring ane,,

hehehe :d
sama" om, skarang msh error ndak ?


RE: Failed to Connect to the Database Metasploit - Arief.Kresna - 06-08-2014

Solusinya dong bro, punya ane muncul gini

Quote:[[email protected]][~]
[>] service postgresql start
[....] Starting PostgreSQL 9.3 database server: main[....] The PostgreSQL server failed to start. Please check the log output: 2014-06-08 21:37:29 UTC LOG: could not bind IPv4 socket: Tidak dapat menempatkan permintaan alamat 2014-06-08 21:37:29 UTC HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 2014-06-08 21:37:29 UTC WARNING: could not create listen socket for "localhost" 2014-06-08 21:37:29 UTC FATAL: could not create any TC[FAILsockets ... failed!
failed!
[[email protected]][~]
[>] service postgresql stop
[ ok ] Stopping PostgreSQL 9.3 database server: main.
[[email protected]][~]
[>] msfconsole
[-] Failed to connect to the database: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Punya ane udah solved bro ternaya cara nya cuman edit /etc/postgresql/9.3/main/postgresql.conf trs search "localhost" yang ada di listen_addresses ganti jadi "127.0.0.1"


RE: Failed to Connect to the Database Metasploit - RobotBernyawa - 06-17-2014

weleh karena saya sering ngalamin jadi penasaran juga, hehehhe
ijin baca-baca mas Clound