
Originally Posted by
ClintBeastwood
I get this using both mysql and postgres
Code:
msf > db_driver mysql[*] Using database driver mysql
msf > db_connect root:toor@127.0.0.1/msf3
[-] Error while running command db_connect: Failed to connect to the database: uninitialized constant MysqlCompat::MysqlRes
Call stack:
/opt/framework3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1842:in `db_connect_mysql'
/opt/framework3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1725:in `cmd_db_connect'
/opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:376:in `run_command'
/opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:338:in `block in run_single'
/opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:332:in `each'
/opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:332:in `run_single'
/opt/framework3/msf3/lib/rex/ui/text/shell.rb:143:in `run'
/opt/framework3/msf3/msfconsole:130:in `<main>'
msf > db_driver
any tips? yes I googled and searched and typed 6 wrong capatchas
I have had the same problem, switching back to ruby 1.8 and rebuilding the mysql module worked for me.
You'll need the follwing package:
Code:
apt-get install libmysqlclient-dev
Then switch back to ruby 1.8:
Code:
update-alternatives --config ruby
Select the first option.
Then:
Start metasploit and connect:
Code:
ruby /pentest/exploits/framework3/msfconsole
db_driver mysql
db_connect user:password@127.0.0.1:3306/database_name
As for postgres, metasploit seems to come with its own postgres instance, you can connect with a config file by the -y switch, which is quite convenient:
Code:
db_connect -y /opt/framework3/config/database.yml