[Kali_metasploit]db_connect a solution that cannot be connected when creating a connection

Source: Internet
Author: User
Tags postgresql psql

Issue 1 Recurrence Path:

1. Terminal input Msfconsole, enter the MSF command line mode, need to wait several minutes;

2. Enter Db_status, check the connection status, two results: one, the default connection msf3; two, no connection, display PostgreSQL selected, no connection

3. Create a connection database Msfbook, enter Db_connect postgres:[email Protected]/msfbook

Phenomenon:

No information displayed, input Db_status view, still not connected

Analysis:

No associated account and password, so unable to connect

Solution:

1. In the # command line mode, enter Sudo-u postgres psql postgres//To create the account

2. You will enter the postgres= #模式下, enter alter user postgres with password ' toor '; To change the password

3. Show alter ROLE//modification takes effect

4. Exit postgres= #模式, re-enter Db_connect Postgres:[email Protected]/msfbook, there will be a lot of verbose information, this is the process of creating a connection data table, This is only a lengthy message when you first create a Postgres Msfbook library, and then no more, just go back to the MSF terminal prompt.

Tips:

Remember to start the PostgreSQL and Metasploit services before entering Msfconsole, with the following commands:

1. Service PostgreSQL start

2. Service Metasploit Start

Issue 2 Phenomenon:

Following the steps above to create a connected database, the MSF prompts you to create a database encoding error, "error while running command db_connect:failed to connect to the Database:pg::inva LidParameterValue:ERROR:new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as on the template database, or use TEMPLATE0 as template.: CREATE database "msfbook" encoding = ' u Tf8 ' Call stack: ... '

Analysis:

Default database encoding Issues

Solution:

1. Sudo-u postgres psql postgres//Enter the Postgres user PostgreSQL database mode

2. Enter CREATE database Msfbook with encoding= ' sql_ascii ';

3. Show create DATABASE//created successfully

[Kali_metasploit]db_connect a solution that cannot be connected when creating a connection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.