Thread: createdb fails
Hi, My first post so I hope this isn't too much of a beginner question for this list. Installed cygwin & postgreSQL 7.4.1 on my XP machine. Ran ipc-daemon2, initdb, pg_ctl as per instructions. A few questionable log messages (see below) but postmaster appeared to have started ok. However, when I try to create a database with createdb -U "My User Name" mydb or even: createdb mydb I get the following error: createdb: could not connect to database template1: expected authentication request from server but received Here is the initdb command I ran: initdb -D /usr/local/pgsql/data Here is the pg_ctl command I ran: pg_ctl -D /usr/local/pgsql/data -l /tmp/pg.log start Got the following in log file: LOG: shmdt(0x1b40000) failed: Invalid argument LOG: database system was shut down at 2004-03-23 22:35:41 EST LOG: checkpoint record is at 0/9EAB40LOG: redo record is at 0/9EAB40; undo record is at 0/0; shutdown TRUE LOG: next transaction ID: 541; next OID: 17142 LOG: database system is ready Despite the first few lines, it does say "database system ready". "pg_ctl ... status" says that postmaster is up and running. I've tried lots of different variations on .conf files, etc. Nothing seems to work. Anybody have any ideas? Getting desparate. Thanks in advance. Bill Chesky billybobc1210@yahoo.com __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html
Hi Bill, Am 26.03.2004 um 06:11 schrieb Bill Chandler: > Installed cygwin & postgreSQL 7.4.1 on my XP machine. > Ran ipc-daemon2, initdb, pg_ctl as per > instructions. A few questionable log messages (see > below) but postmaster appeared to have started ok. > > However, when I try to create a database with > > createdb -U "My User Name" mydb > > or even: > > createdb mydb > > I get the following error: > > createdb: could not connect to database template1: > expected authentication request from server but > received This message looks incomplete to me somehow. Some ideas though: - Perhaps the pg_hba.conf settings don't allow to connect to template1? It should contain lines like local all all trust host all all 127.0.0.1 255.255.255.255 trust - Did you try psql -h localhost -l # list all databases: template0 and template1 should show up ^^^^^^^^^^^ connecting using TCP/IP instead of socket? In postgresql.conf then there must be tcpip_socket = true - Perhaps you have another copy of PostgreSQL installed? Mixing the client of one version with the server of another gives mostly unexpected results. > Got the following in log file: > > LOG: shmdt(0x1b40000) failed: Invalid argument This is "normal" on cygwin, I heard (my log has it too, but PG works well). The other messages are even more normal, documenting ordinary server operation. Hope it helps a bit, Best regards, Christof Glaser -- -- gl.aser . software engineering . internet service -- Doelitzer Strasse 37 . D-04277 Leipzig . fon +49-341-303 20 51 -- http://gl.aser.de/ . sms +49-177-779 28 43 . fax +49-0341-303 20 52
--- Christof Glaser <gcg@gl.aser.de> wrote: > Some ideas though: > > - Perhaps the pg_hba.conf settings don't allow to > connect to template1? > > It should contain lines like > local all all trust > host all all 127.0.0.1 255.255.255.255 trust Yes, my pg_hba.conf contains both these lines. > - Did you try > psql -h localhost -l # list all databases: > template0 and template1 > should show up This gives me the message: Could not receive server response to SSL negotiation packet: Resource temporarily unavailable At this point I tried starting postmaster directly with SSL connection enabled using the command: postmaster -l -D /usr/local/pgsql/data & This failed with the log message: FATAL: could not load server certificate file "/usr/local/pgsql/data/server.crt": No such file or directory > connecting using TCP/IP instead of socket? > > In postgresql.conf then there must be > tcpip_socket = true Yes, I have this line in postgresql.conf. > - Perhaps you have another copy of PostgreSQL > installed? > Mixing the client of one version with the server of > another gives > mostly unexpected results. Nope, this is the only version I've ever installed. Could I have installed it wrong somehow? I followed the instructions here: http://www.postgresql.org/docs/faqs/text/FAQ_MSWIN The only thing I did differently (I'm pretty sure -- it's been a couple of weeks) was that when I first attempted to run initdb I got an error about not having an encryption package installed. I did some research on the web and found others solved the problem by installing the cygwin package: Libs -> "crypt: Encryption / Decryption utility and library Could it be a config problem on my XP box? Is there something I need to change in my networking configuration? Thanks again. Bill __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html
> Ah it's SSL. Try to disable SSL in postgresql.conf, > then it should work. > Nope. Same results. In fact, it looks like ssl=false is the default anyway right? So I've been running w/ SSL off all along. > If you really need SSL, then you have to create > that missing certificate file - don't ask me how, > I don't know. (The file is there on my Debian Linux > installation.) Well, I found out at: http://www.postgresql.org/docs/7.4/static/ssl-tcp.html Created server.crt file as per instructions above. Set ssl=true in postgresql.conf. Postmaster started successfully. Tried to createdb. Same message!!! BTW, this is after uninstalling and reinstalling Cygwin and PostgreSQL. I feel like I must have done something wrong on installation. Or maybe my machine is configured strangely. I followed the instructions at: http://www.postgresql.org/docs/faqs/text/FAQ_MSWIN Are these instructions complete? thanks, Bill __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html