PostgreSQL on Mac unable to login to database

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

PostgreSQL on Mac unable to login to database

Postby joaoleao » Sat Oct 27, 2012 2:28 pm

Hi

I just had my Macbook Pro hard drive replaced. I had a Time Machine backup and just migrated all the data to the new disk.
When I opened PT3 for the first time, a small window with the title "Configure PostgreSQL Database" popped up. In this window I clicked "Browse Databases" and got an error message saying "Unable to login to database(template1). Reason: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.sPGSQL.5432?""

I'm aware of another thread (https://www.pokertracker.com/forums/vie ... 17&t=42906) where this was suggested:
sudo su postgres -c '/Library/PostgreSQL/9.0/bin/pg_ctl -D /Library/PostgreSQL/9.0/data/ restart'

It didn't work for me (as my version of is 8.4 and I appropriately replaced "9.0" for "8.4" in that string). Terminal spitted a somewhat complicated output.

Should I re-install or install a newer version of PostgreSQL? Will I lose previous data when I do this?

Thanks in advance.
Joao
joaoleao
 
Posts: 35
Joined: Fri May 27, 2011 11:42 am

Re: PostgreSQL on Mac unable to login to database

Postby kraada » Sat Oct 27, 2012 2:45 pm

Please paste the output the terminal gave you - that will help determine what is going on here.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: PostgreSQL on Mac unable to login to database

Postby joaoleao » Sat Oct 27, 2012 2:53 pm

kraada wrote:Please paste the output the terminal gave you - that will help determine what is going on here.


Here it is:

pg_ctl: PID file "/Library/PostgreSQL/8.4/data/postmaster.pid" does not exist
Is server running?
starting server anyway
server starting
Apples-MacBook-Pro:~ joao$ 2012-10-27 19:50:52 WESTFATAL: could not create shared memory segment: Invalid argument
2012-10-27 19:50:52 WESTDETAIL: Failed system call was shmget(key=5432001, size=36872192, 03600).
2012-10-27 19:50:52 WESTHINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 36872192 bytes), reduce PostgreSQL's shared_buffers parameter (currently 4096) and/or its max_connections parameter (currently 103).
If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
The PostgreSQL documentation contains more information about shared memory configuration.
joaoleao
 
Posts: 35
Joined: Fri May 27, 2011 11:42 am

Re: PostgreSQL on Mac unable to login to database

Postby kraada » Sat Oct 27, 2012 3:07 pm

Run this at the terminal and paste the output here for me:

cat /etc/sysctl.conf
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: PostgreSQL on Mac unable to login to database

Postby joaoleao » Sat Oct 27, 2012 3:21 pm

kraada wrote:Run this at the terminal and paste the output here for me:

cat /etc/sysctl.conf


cat: /etc/sysctl.conf: No such file or directory
joaoleao
 
Posts: 35
Joined: Fri May 27, 2011 11:42 am

Re: PostgreSQL on Mac unable to login to database

Postby kraada » Sat Oct 27, 2012 5:09 pm

Ok, at the terminal type:

sudo nano /etc/sysctl.conf

It will bring up a text editor. Type in:

kern.sysv.shmmax=67108864
kern.sysv.shmmin=1
kern.sysv.shmmni=256
kern.sysv.shmseg=64
kern.sysv.shmall=16384

Press ctrl+o and enter to save the file, then ctrl+x to exit. Then restart your computer and PostgreSQL should work properly.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: PostgreSQL on Mac unable to login to database

Postby joaoleao » Sun Oct 28, 2012 12:24 pm

It's working now.
Thanks kraada :)
joaoleao
 
Posts: 35
Joined: Fri May 27, 2011 11:42 am

Re: PostgreSQL on Mac unable to login to database

Postby clartann » Fri Oct 11, 2013 6:51 pm

I get the same error

I tried the solution above, but my settings are the same as below. I'm not sure what to do to get it to work
clartann
 
Posts: 3
Joined: Fri Oct 11, 2013 6:48 pm

Re: PostgreSQL on Mac unable to login to database

Postby WhiteRider » Sat Oct 12, 2013 5:04 am

Can you tell us what you did before this error started, or did you never have this working?
Do you have PostgreSQL installed on your computer?
WhiteRider
Moderator
 
Posts: 53972
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: PostgreSQL on Mac unable to login to database

Postby clartann » Tue Oct 15, 2013 7:21 pm

postgresql was installed automatically. I've never had PT working
clartann
 
Posts: 3
Joined: Fri Oct 11, 2013 6:48 pm

Next

Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 8 guests

cron
highfalutin