PDA

View Full Version : cant connect to postgress



A.Kmicic
03-22-2011, 10:25 AM
when i try to start holdem manager:

" The following error occurred when trying to open the database: Failed to establish a connection to '127.0.0.1'. "


Win7 x64,
read: http://faq.holdemmanager.com/questio...rt+PostgreSQL+ and no help.

tried to reboot
tried to start service in services
UAC off,
windows defender off
tried "local system account"

i have Eset Security and disabled windows updates both for long time
HEM 1.11.06b Internal 1 for some time


tried loggin in to PGAdmin, i click postgreSQL, type password, and windows shows: "server doesn't listen" window

i have no postmaster.pid file, i have enabled the hidden file visibility options





in Eset security i added exception for psql.exe ( just shot in the dark ) -> went to services -> tried to stars PostgreSQL and window pops up: "Windows system cant start PostgreSQL server 8.4 on komputer: Local Computer

error1069: service has not been started casue of failed logging in"

Patvs
03-22-2011, 12:40 PM
Reinstall PostgreSQL 8.4.7 from PostgreSQL: The world's most advanced open source database (http://www.postgresql.org)

Also try to install SQL 9.0.3 to port 5433 to check if you can connect to that.

A.Kmicic
03-23-2011, 08:25 AM
ImageShack® - Online Photo and Video Hosting (http://img837.imageshack.us/i/gownoj.jpg/)
i uninstalled postgress
and deleted postgres as a user in C:/Users/postgres ( also tried witout deleting it )
tried installing to different location
i put the same password i had, i put diferent, it's the same

fuck is wrong now?


how do you Turn off Windows User Account?

netsrak
03-23-2011, 09:01 AM
Please open a command box as administrator and type in the following command:

net user postgres /delete

This deletes the whole postgres user and you can assign a new password during the installation.

A.Kmicic
03-23-2011, 09:40 AM
i managed to solve the problem in this post


[ how i solved the problem: : deleted all signs of postgres in "regedit" then computer didnt want to start, so in emergency mode i used CCleaner x64 and it worked, now again i have HEM working ]




ok it worked, installation went ok, and HEM worked, but i wanted to get my database back ( my notes exactly, cause hands i have in archive folder ) so i swiched "data" folder in C:\Program Files (x86)\PostgreSQL\8.4 for the old one

not only it didnt work, now in Users folder i have:

postgres
postgres.AK47
postgres.AK47.000

( not sure how to delete net user with "." cause net user postgres.AK47 /delete doesnt work )

and in services there is postgres 8.4 ( under user postgres which i deleted for 2nd time ) still after uninstallation of postgres and i cant start new installation

i guess after new installation i have to try to get acces to the old database with pgAdmin ( i stored old C:\Program Files (x86)\PostgreSQL in another directory )

A.Kmicic
03-23-2011, 10:45 AM
now only thing i need is to:


access my old database now ( have all the files in different folder ) to export my HEM notes, how can i do that? ( it was impossible before cause i couldn't log to pgAdmin also )

i used search and i saw that The PostgreSQL database is stored in: /Program Files/PostgreSQL/8.x/data/base/#####

but simply moving those old database files to the new Postgres folder doesnt do it, what can i do for HEM to see this database/files?

Patvs
03-23-2011, 12:14 PM
You need to reinstall PostgreSQL (with the installer from PostgreSQL: The world's most advanced open source database (http://www.postgresql.org)) and when you have to enter the location of the /data folder, select the /data folder where your old database is stored,


Don't manually delete user/postgres.AK47 folders. It's normal postgres will create several user folders. Only use a DOS prompt with 'net user postgres /delete'


---

If your PostgreSQL server won't run (or the installation won't finish) when you select the data folder containing your old database. 9 out of 10 times, this is because there was a corruption in one of the indexes in the old database. And it will be impossible to connect to it / retrieve notes from it.

1 out of 10 times, you can still connect to it, by moving the database folder to a non-Program Files subfolders first. For example move everything to C:/PostgreSQL. And reinstall to that location instead. Also select a different port number when you do this. (5433)

If during the installation of PostgreSQL you don't get the chance to select the location of the data folder, and select a new port (because it will auto-detect the old info), uninstall PostgreSQL first with Revo Uninstaller (free version)..... because it's essential all the old registry keys with the old info are deleted from your system's registry.

A.Kmicic
03-23-2011, 01:12 PM
if i move whole "data" folder it still doesnt allow me to choose port even when i remove Postgres with Revo Uninstaller ( after using Revo also used the net user postgres /delete command )

in the installation window after choosing the folders it says: " An existing directory has been found at .... set to use port 5432. This directory and its configuration will be used for this installation."

if i just move "base" folder it says its not recognizeble

Patvs
03-23-2011, 01:52 PM
Run: regedit (so manually delete the entry in your registry that contains the port info)


Run a search for: PostgreSQL and delete the "port 5432 data".

A.Kmicic
03-23-2011, 02:26 PM
[EDIT: OMG OMG OMG i gave it last shot, reinstalled PostgreSQL to different folder with the old "data" folder with the port that he makes me do it - 5432 - and deleted postmaster.pid - as it gives this file after new instalation - and IT WORKED, i have my old database back. thanks!!!! ]




deleted everything about PostgreSQL in regedit ( there was no info about port in any of the deleted entries ) and still cant choose port :/
also tried searching for port 5432 or 5432 data but nothing found, if i try to find just 5432 there are too many folders with that name

i looks like the info about the port is in the data folder itself :/

Patvs
03-23-2011, 06:41 PM
Start by creating a monthly backup of your notes (and database).

These type of PostgreSQL problems are fairly common. And if you'd ever have a database corruption (without knowing it), you won't be able to connect to the /data folder when that happens.

A.Kmicic
03-23-2011, 09:06 PM
yeah i will start doing that, thx:)

as soon as my HEM started working i exported notes :D database is no problem cause there's the archive option - so all hands secured in different location:)