Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot connect to postgresql database #1

Open
shea256 opened this issue Mar 23, 2015 · 3 comments
Open

cannot connect to postgresql database #1

shea256 opened this issue Mar 23, 2015 · 3 comments

Comments

@shea256
Copy link

shea256 commented Mar 23, 2015

Hi when I started up the emailer for the first time I got this:

(mitromailer)mitro-mailer-$ python emailer.py
INFO:root:Starting up email queue
CRITICAL:root:(OperationalError) could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

After messing around with it for a bit, I realized that I had to start up postgresql and then create a database and a user and then the appropriate tables.

I've never used postgresql or sqlalchemy before, so I've just been going off of what I could google. I gather there's a simple way to create the db, user, tables, etc. just from the file email_queue_model.py. If so, could you please advise what that is?

Also, I would like to suggest including instructions for this part in the setup guide.

@shea256
Copy link
Author

shea256 commented Mar 24, 2015

@croemmich any thoughts on this one?

@winstonhong
Copy link

Hello shea256.

You can follow the following procedure to build the mitro database.

(1)
postgres -D ../mitro-core/build/postgres

this command automatically runs postgres server on the port 5432

Note that you need to keep postgresql server always running

(2)
/usr/lib/postgresql/9.1/bin/createdb -O mitro mitro

the path may be different for creatdb

this command automatically creates the database "mitro" with a user (username "mitro" and password is null)

(3)
../mitro-core/ant server

this command automatically creates tables for the database "mitro"

@servomac
Copy link

servomac commented Aug 6, 2015

It is possible to connect to a postgres server using a real password, not a null one?

EDITED: Obviously, just editing config.ini!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants