Project

General

Profile

Actions

Bug #5133

open

Dbo tutorial

Added by Marko Taht over 7 years ago. Updated over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/27/2016
Due date:
% Done:

0%

Estimated time:

Description

Wt dbo tutorial should be updated. Im trying to run my Wt app with postgreSQL but since it seems to be lot harder to set up than mySQL, i cant get it working. Main question i have is: Do i have to create database before in some other program or manager? If not then how do i connect the Wt in such a way that it would work?

Im getting connection refused. They say i should use username and password, but since there currently is no database, i dont know where to add it or if i even need it.

This is how i set up session

@ dbo::backend::Postgres postgres("host=127.0.0.1 port=5432 dbname=Maalid connect_timeout=0");

dbo::Session session;

session.setConnection(postgres);@

Actions #1

Updated by Koen Deforche over 7 years ago

Postgres can be indeed frustrating to configure.

  • Check if your postgres is indeed running by trying to connect first using 'psql'
  • You need to first create a database using SQL (e.g. using psql) or using 'makedb'
  • The postgres configuration out of the box differs for each distro.
  • Connection refused probably means that your server isn't running, or isn't listening for TCP connections. That means you should be able to connect without 'host=127.0.0.1 port=5432'

Koen

Actions #2

Updated by Marko Taht over 7 years ago

OK i got it fixed. Problem was i needed separate DB server :D. But from tutorial i understood that WT has everything. So maybe mention it somewhere.

Actions

Also available in: Atom PDF