Wordpress Postgresql



  1. Restart Postgresql Windows
  2. Postgresql With Wordpress
  3. Install Wordpress On Postgresql

Your WordPress database credentials are stored in the wp-config.php file. It is the WordPress configuration file that contains important WordPress settings including database information. If you have not edited wp-config.php file before, then take a look at our guide on how to edit wp-config.php file in WordPress. PostgreSQL is a important database, but WordPress can’t support it now. I hope WordPress will support PostgreSQL. Not only PostgreSQL,but also others databases are not support directly. You must write configs or install plugins then WordPress will works.

Postgres has a very useful ‘COPY’ command that can be used to transfer data between text files and database tables. This is somewhat similar to Oracle’s SQLLDR utility. I will discuss some of the basic commands to get data from a text file and write them into database tables.

A lot of times, the text files may come in the form of a CSV (Comma-Separated Values) document. It is also easy to create a CSV file from popular spreadsheets like MS Excel. In order to copy data from a CSV file into a database table, you can run the following SQL command:

COPY myschema.mytable
FROM 'c:/dir1/file1.csv'
DELIMITERS ',' CSV;

Note that although the input file is on a Windows machine, we still used the ‘/’ path separator character instead of ‘’.

One problem with running the COPY command as an SQL command is that you can only run it as superuser (i.e. ‘postgres’ on most systems) or your account needs to have the superuser privilege. If you run this command as a regular user, you will get an error message like this:

ERROR: must be superuser to COPY to or from a file
HINT: Anyone can COPY to stdout or from stdin. psql's copy command also works for anyone.

One way to overcome this is to run a variant of the command on the ‘psql’ prompt. ‘psql’ is the Postgres equivalent of Oracle’s ‘sqlplus’.

psql=> COPY myschema.mytable FROM c:/dir2/file2.txt delimiter '|'

Note that ‘COPY’ command uses the word ‘DELIMITERS’ whereas the ‘COPY’ command uses ‘DELIMITER’. It took me some time to figure it out. This time I used a pipe-delimited file instead of a comma-delimited file. Both forms are pretty common in the ETL (Extract Transform Load) world.

Now, imagine that you have a bunch of input files and you need to copy the data to a number of destination tables. Instead of typing the commands on psql every time, you could have a .sql file where you write all the copy commands and run that file from psql using psql’s ‘i’ command. Assuming you have all your copy commands in a file called input.sql:

COPY myschema.mytable1 FROM c:/dir1/file1.txt delimiter '|'
COPY myschema.mytable2 FROM c:/dir2/file2.txt delimiter '|'
....

You can now do the following from psql:

psql=> i input.sql

If you want to go one step further and run the whole thing using a shell script, you can write a script like this:

Let’s call this script myscript.ksh. So, at this point, all you will need to do is the call the script like this:

./myscript.ksh <db_host> <db_name> <db_user>


and you should get all the data copy done.

In case you are wondering why I used ksh.exe at the top of the shell script, I wrote the script on Windows under the Cygwin environment. I have kept the article simple and small. For more information on PostgresSQL’s COPY command, you can always google it!

PostgresqlPostgresql
Installing Metasploit Framework + PostgreSQL Under VMware BackTrack 5

I’ve just installed the new and improved BackTrack 5 in VMware. As always, i made an apt-get update && apt-get dist-upgrade -y and after that a msfupdate.I launched Metasploit framework, and was about to start postgresql when i realized that BT 5 is with MySQL.

I created a workaround script, its not pretty but it works. You will need the following packages installed before running the script:

apt-get install postgresql-client libpq-dev

Copy the script into a file e.g script.sh,

chmod +x script.sh, ./script.sh

Wordpress Postgresql

The commands (script.sh ) I used was:

With
Result of the script

root@bt:/opt/framework3# ./script.sh
Killing database process ..
Allowing all local IPV4 connections ..
Restarting postgres server (only necessary during this process, on reboot it will start automatically) ..
FATAL: bogus data in lock file „postmaster.pid”: „”
Changing postgres user postgres’s password to ‚postgres_password’ ..
Creating database ‚msf_db’ for use with metasploit ..
Changing back to md5 auth ..
##################################
Changing Ruby version – please choose the ‚0’ option ..
##################################
There are 2 choices for the alternative ruby (providing /usr/bin/ruby).

Selection Path Priority Status
————————————————————
0 /usr/bin/ruby1.8 500 auto mode
1 /usr/bin/ruby1.8 500 manual mode
* 2 /usr/bin/ruby1.9.2 400 manual mode

Press enter to keep the current choice[*], or type selection number: 0
update-alternatives: using /usr/bin/ruby1.8 to provide /usr/bin/ruby (ruby) in auto mode.
Building native extensions. This could take a while…
—————————————————————————

This is an old, deprecated version of the Ruby PostgreSQL driver that hasn’t
been maintained or supported since early 2008.

You should install/require ‚pg’ instead.

If you need the ‚postgres’ gem for legacy code that can’t be converted, you can
still install it using an explicit version, like so:

gem install postgres -v ‚0.7.9.2008.01.28’
gem uninstall postgres -v ‚>0.7.9.2008.01.28’

If you have any questions, the nice folks in the Google group can help:

http://goo.gl/OjOPP / ruby-pg@googlegroups.com

—————————————————————————
Successfully installed pg-0.13.2
Successfully installed postgres-0.8.1
2 gems installed
Installing ri documentation for pg-0.13.2…

Enclosing class/module ‚rb_mPG’ for class Connection not known

Enclosing class/module ‚rb_mPG’ for class Result not known
Installing ri documentation for postgres-0.8.1…
Installing RDoc documentation for pg-0.13.2…

Enclosing class/module ‚rb_mPG’ for class Connection not known

Enclosing class/module ‚rb_mPG’ for class Result not known
Installing RDoc documentation for postgres-0.8.1…
Updating msf ..
[*]
[*] Attempting to update the Metasploit Framework…
[*]

A external/source/armitage
A external/source/armitage/lib
A external/source/armitage/lib/postgresql-9.1-901.jdbc4.jar
A external/source/armitage/lib/sleep.jar
A external/source/armitage/lib/msgpack-0.5.1-devel.jar
A external/source/armitage/lib/jgraphx.jar
A external/source/armitage/scripts
A external/source/armitage/scripts/tokens.sl
A external/source/armitage/scripts/server.sl
A external/source/armitage/scripts/shell.sl
A external/source/armitage/scripts/modules.sl
A external/source/armitage/scripts/targets.sl

Restart Postgresql Windows

………………………………………………………………..

##################################################
starting msfconsole ..
##################################################

Call trans opt: received. 2-19-98 13:24:18 REC:Loc

Trace program: running

wake up, Neo…
the matrix has you
follow the white rabbit.

knock, knock, Neo.

Wordpress

(`. ,-,
` `. ,;’ /
`. ,’/ .’
`. X /.’
.-;–”–.._` ` (
.’ / `
, ` ‚ Q ‚
, , `._
,.| ‚ `-.;_’
: . ` ; ` ` –,.._;
‚ ` , ) .’
`._ , ‚ /_
; ,”-,;’ „-
„-..__„–`

Postgresql With Wordpress

=[ metasploit v4.4.0-dev [core:4.4 api:1.0]
+ — –=[ 843 exploits – 471 auxiliary – 142 post
+ — –=[ 250 payloads – 27 encoders – 8 nops
=[ svn r15247 updated 5 days ago (2012.05.03)

msf > db_status
[*] postgresql selected, no connection
msf > db_connect postgres:postgres_password@127.0.0.1:7175/msf_db

Install Wordpress On Postgresql

msf > db_status
[*] postgresql connected to msf_db