Issue 1 Recurrence Path:
PostgreSQL selected, no connection
First step: Db_connect postgres:[email Protected]/msfbook
Connection success does not require a next step
If it fails:
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 ' in msfconsole mode; 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 PostgreSQL before starting to enter the Msfconsole command as follows:
1. Service PostgreSQL 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