Installed Postgresql 10 from Slackbuilds on 14.2 and can't login to database
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Installed Postgresql 10 from Slackbuilds on 14.2 and can't login to database
I followed the steps on slack build and installed Postgresql using the user and group Postgres with no password and now struggling to login to database.
Database is running but can't connect.
Do I need to give the user Postgres a password first? Actually tried changing it and it can't be changed apparently.
What does "can't connect" mean? Please detail.
Have you got your database storage(cluster) initialized with initdb?
I'd suggest to always switch to user postgres for maintenance (even connecting) on console - use: su - postgres
If you want to connect to the db as a different user, use: psql -U postgres postgres
(given the default db is called postgres)
* Go to your cluster dir (``/var/lib/pgsql/10.2/data`` for postgres installed from slackbuilds)
* Open ``pg_hda.conf``
* add the following line ``local postgres postgres trust``
* restart posgres ``/etc/rc.d/rc.postgresql restart``
* connect ``$ sudo -u postgres psql``
* set password: ``# \password``
* remove line you added to ``pg_hda.conf``
* restart posgres ``/etc/rc.d/rc.postgresql restart``
* connect using password
As a point of clarification - what is listed in SBo isn't to be taken as somehow an endorsed version per say. While the maintainer of that SBo may in fact endorse a specific version of a software package, that doesn't necessarily mean it's the most preferred option out there. The only thing that can be reliably ascertained is "this is a specific combination that is known to work."
In the case of Postgresql, I would say that 10 is a bit old at this point, and I made a trivial change (I think it was just the version number) to build the 11 series. I generally follow a project's most recent stable release, so I'll jump to Postgresql 12 soon as well. You can offer changes back to the SBo project if you think that the scripts for building that software are outdated. (Recommended that you first contact the script maintainer directly, however.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.