Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
msfconsole 3.7.1 an postgresql
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Thu Jun 09, 2011 7:26 am    Post subject: msfconsole 3.7.1 an postgresql Reply with quote

I' m using metasploit framework donloaded from the official site and postgresql.
I don' t understand how to set the default encoding (in postgresql).
Code:

msf > db_driver postgresql
[*] Using database driver postgresql
msf > db_connect lott
[-] Error while running command db_connect: Failed to connect to the database: PGError: ERROR:  new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT:  Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "lott" ENCODING = 'utf8'

Call stack:
/opt/framework-3.7.1/msf3/lib/msf/ui/console/command_dispatcher/db.rb:2021:in `db_connect_postgresql'
/opt/framework-3.7.1/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1724:in `cmd_db_connect'
/opt/framework-3.7.1/msf3/lib/rex/ui/text/dispatcher_shell.rb:376:in `run_command'
/opt/framework-3.7.1/msf3/lib/rex/ui/text/dispatcher_shell.rb:338:in `block in run_single'
/opt/framework-3.7.1/msf3/lib/rex/ui/text/dispatcher_shell.rb:332:in `each'
/opt/framework-3.7.1/msf3/lib/rex/ui/text/dispatcher_shell.rb:332:in `run_single'
/opt/framework-3.7.1/msf3/lib/rex/ui/text/shell.rb:143:in `run'
/opt/framework-3.7.1/msf3/msfconsole:130:in `<main>'
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Mon Jun 13, 2011 6:58 am    Post subject: Reply with quote

Isn' t there someone can help me?
Back to top
View user's profile Send private message
yoshi314
l33t
l33t


Joined: 30 Dec 2004
Posts: 848
Location: PL

PostPosted: Mon Jun 13, 2011 7:53 am    Post subject: Reply with quote

if you have no databases you can erase the postgresql directory, and set up the data directory again, by doing

Quote:
initdb --locale=en_US.utf8 --auth="ident sameuser" /var/lib/pgsql/data
which should init the postgresql cluster in utf8. assuming that /var/lib/pgsql/data is where your databases are stored.

this will mean that other databases should default to utf8 as well. (but it might depend on your locale).

i don't really run postgresql on gentoo, so that directory might be different.

you can verify that by logging in from postgresql user to the database template1

results should be somewhat similar to this :
Code:
sudo -u postgres psql template1
template1=# \l
(...)
 template0               | postgres | UTF8
 template1               | postgres | UTF8
(..)

_________________
~amd64
shrink your /usr/portage with squashfs+aufs
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Mon Jun 13, 2011 4:42 pm    Post subject: Reply with quote

Yes, thanks for the reply.
The locale "now" is utf-8 (at the time of the installation not)
I erase the directory /var/lib/postgresql and give emerge --config postgresql-server
Everything works fine, Thanks.
Back to top
View user's profile Send private message
titanofold
Developer
Developer


Joined: 30 Dec 2003
Posts: 235
Location: Bryson City, NC USA

PostPosted: Sat Jul 16, 2011 8:17 pm    Post subject: Reply with quote

You can also, you know, read the instructions that direct you to edit /etc/conf.d/postgresql-${SLOT} because that file can affect the behavior of emerge --config =dev-db/postgresql-server:${SLOT}, which shows an example of setting the locale which also lets you specify an encoding
_________________
The best things in life are free.
Guy-1: Surely, you will fold with me...
Guy-2: Alright, but don't call me Shirley
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum