3 ms·
Hey, I use elementary OS and all I did was sudo apt-get install postgres I have no idea what it installed and what it didn't, in the entire process never once
by thewhitetulip 11y ago
Hey,
I use elementary OS and all I did was sudo apt-get install postgres
I have no idea what it installed and what it didn't, in the entire process never once it asked me for a password and while connecting to the database it says that invalid password and I can't reset password without connecting to the database!!
May I know your email ID? so I'll try to install it once and tell you how it goes.
As of now I have everything installed plus the graphical client with the elephant logo, but I just have no idea what the password is
- simoncion 11y ago> ...the entire process never once it asked me for a password and while connecting to the database it says that invalid password and I can't reset password without connecting to the database!! Well, because you have access to the file that causes Postgres to determine whether or not you need to provide a password to access a given database (pg_hba.conf), you could simply change the authentication method to one that doesn't ask for a password. :) However. On every Postgres install I've ever used, there are the following lines in pg_hba.conf: # "local" is for Unix domain socket connections only local all all trust If we look carefully, we see that the Type, Database, User, and Method entries are present, but the Address entry is not. The comment also talks about a Unix domain socket connection. Reading the "Connecting to a Database" section of the manual for psql [0] (the official command-line Postgres client) tells us that if we omit the hostname, psql attempts to connect over the Unix domain socket. So, try the following things: * psql When that fails, because 'role "$MY_USERNAME" does not exist', try * psql -U $DATABASE_USER (The Postgresql database user is typically postgres.) If that fails for some other reason, try * sudo su - $DATABASE_USER * psql You should now be connected to Postgres. If we enter help , we see that we can enter "\?" for help with psql commands. If we enter \? and look through the list of commands, we should see one that does exactly the thing that we're trying to accomplish. Anyway, leave a message here to let me know how this all went, or to ask any follow up questions. [0] http://www.postgresql.org/docs/9.4/static/app-psql.html http://www.postgresql.org/docs/9.4/static/app-psql.html
- thewhitetulip 11y agoI'll check this out tonight
- thewhitetulip 11y agoHey man, thank you very much, I was somehow able to connect to the psql database :) i created a user, a database and successfully created and dropped a table! HN these days is full of elitist people who think the people who are struggling with things are downright dumb, hence the multiple downvotes I got on the earlier comment. It is because of people like you, my friend, that HN is still a user friendly community :) Thank you!!
- simoncion 11y ago> ...I was somehow able to connect to the psql database... Yeah? For posterity, mind detailing how did you do it? > HN these days is full of elitist people who think the people who are struggling with things are downright dumb... No. That's not what happened. You said: > I have never been able to actually download install and use [Postgresql] ... unfortunately it isn't as simple as installing mysql[.] Everyone who has installed both MySql and and Postgres know that you need to do exactly the same things [0] -albeit in slightly different ways to get started from scratch. Initial configuration of MySql and Postgres is equally complicated. [1] This makes your comment look like an anti-Postgres slam. Cynical people might suspect that your original comment was the time-tested "Man, thing X sucks, can't do Y, and is completely useless!" Internet tech-support bait, but that ain't me, baby. Over the years, I've found great profit in assuming that most widely-used non-B2B software [2] is actually generally well designed and thought-out, and that any inability to do a thing is a result of my lack of understanding or familiarity rather than poor or difficult design of the software. Why? Because, -frankly- such failures are pretty much always a result of my lack of understanding. [0] Configure listen IP, create a superuser account, set database access permissions, create a database, start the daemon. [1] That is, (compared to writing software that uses SQL) not complicated at all, and just as complicated as configuring any other non-trivial daemon. [2] And some B2B software, too.
- 11y ago