These notes will walk you through installing the programs you need to work from home in CSE 444:
We assume here that you're using Windows. If you're using Mac OS X or Linux, please help us out by contributing notes for your OS.
Please remember that we only support CSE Instructional Lab-supported computers. If you are having trouble getting your assignment running at home, please try running it on a Lab machine.
C:\Program Files
to
C:\Program Files (x86)
in the Installing PostgreSQL and Adapting the PostgreSQL instructions sections.Download and install the Java SDK 6, update 17 from Sun.
Follow these steps:
C:\Program Files\psqlJDBC\postgresql-8.4-701.jdbc4.jar
.C:\Program Files\PostgreSQL\8.4\bin\psql.exe
and
C:\Program Files\psqlJDBC\postgresql-8.4-701.jdbc4.jar
exist.To install the SQL Server JDBC driver, download it from here,
and save it as C:\Program Files\Microsoft SQL Server 2008 JDBC Driver\sqljdbc4.jar
.
With two major exceptions, the PostgreSQL instructions for Lab machines still apply to working from home.
The first exception is that you can completely skip the sections titled "Creating a data folder" and "Starting and stopping PostgreSQL". The installer already created a data folder, so you don't need to create one yourself, and it set up PostgreSQL to start and shut down along with the computer, so you don't need to start it explicitly.
The second exception is the way you log in to the database system. On Lab machines (when following the suggested procedure for creating a data folder), you are not normally asked for a username or password when connecting to the database. This is because your PostgreSQL username is the same as your Windows username (the default username for PostgreSQL client tools and libraries), and PostgreSQL automatically trusts all connections from the local computer, so any local user can connect using any PostgreSQL username without providing a password.
By default, however, PostgreSQL installed using the Windows installer will prompt you for a
username and password; you will need to use postgres
for the username and the
"database superuser password" you previously set for the password. There are two ways to work
around this problem:
net stop postgresql-8.4
), then
run it manually using a data folder created with initdb
, as you would do on a Lab
computer.initdb
.
This is a two-step process:
C:\Program Files\PostgreSQL\8.4\data\pg_hba.conf
.# IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5by changing "md5" to "trust", so they read:
# IPv4 local connections: host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 trust
> net start postgresql-8.4
> createuser -U postgres -s "%USERNAME%"
This command creates a PostgreSQL user with administrative privileges (-s
),
and the same name as your Windows username (value of the environment variable
USERNAME
), using the authority of the existing database superuser (-U
postgres
).