Download Mayday User Guide

Transcript
How to use the Mayday Project Database
Mayday How-To Series
For the long version see the rest of this section. The steps to set up the database are
described using command line programs, but they can also be executed using the
graphical front end pgAdmin which is available for linux, Mac OS and windows.
Note: If you have already MayDB up and running on your system, skip all but the
last step in the next section.
Installing PostgreSQL
The first and most important step for preparing PostgreSQL is of course installing
it on your machine. PostgreSQL sources and binaries for some linux distributions
and windows are available from www.postgresql.org/download. It is also
included in many linux distributions.
For Mac OS see http://www.entropy.ch/software/macosx/postgresql/
for instructions.
As instructions for installing (let alone compiling) PostgreSQL would go too
far here, please refer to the documentation (enclosed to PostgreSQL or at
http://www.postgresql.org/docs/ for details.
Make sure that the PostgreSQL backend application (linux: postmaster; windows: postgres.exe) is running.
TCP-IP Connections
The standard way to use databases with Java is the JDBC interface. In order to use
PostgreSQL with JDBC, the PostgreSQL backend must accept TCP/IP connections.
If this is not the case on your machine, you need to do the following:
• The main configuration file of PostgreSQL is postgres.conf. This must
contain the line
tcpip_socket = true
Also check the other connection settings for compatibility with the used
system.
• The file pg_hba.conf is used to set up the privileges of the users which use
the database.
Add the following (or a similar) line to this file:
host
all
255.255.255.255
all
trust
127.0.0.1
\\
This line allows all local users using IPV4 (for IPV6 see file and documentation) to connect to PostgreSQL without password. This is very convenient
(→ Spooling) but somewhat dangerous. Change trust to something other
December 9, 2005
62