On Thursday 31 Dec 2015 16:28:36 J. Roeleveld wrote: > On Thursday, December 31, 2015 01:50:43 PM Mick wrote: > > On Thursday 31 Dec 2015 11:14:48 J. Roeleveld wrote:
> > So, I'm reading the fine manual again, but I find myself asking questions > > like ... how do I do this MySQL command on postgres; e.g. on MySQL I set > > up a mysql root user passwd before I do anything else. Isn't this the > > case with postgres? > > Not really. > The following is based on the default when using Postgresql on Gentoo. > > When following the post-inst steps emerge tells you, the database is > initialised to run as "postgres". > It also auto-creates a "postgres" user in the database. This user has full > privileges. Yes, I did just so: 'emerge --config dev-db/postgresql:9.4' > I only use that user to create additional users and databases. No other > user, on my installations, has permissions to add users/databases. > Usually I do give them full permissions within the databases. I used the postgres user to create ROLE michael, and made michael OWNER of the akonadidb and GRANTed him ALL PRIVILEGES on akonadidb. However .... I did not give michael's ROLE any LOGIN. Apparently, had I created USER instead of ROLE, it would automatically have LOGIN rights. As it was I had to run: ALTER ROLE michael WITH LOGIN SUPERUSER PASSWORD 'somepasswd'; I am not sure if SUPERUSER is an overkill or a security weakness. Perhaps I should reduce it to ADMIN? In any case, now akonadi can login with michael without any problems. :-) > > PS. Would any postgresql gurus know why I can't login with some arbitrary > > name/passwd in the postgres database? > > Yes :) > > But this is a bit OT for this thread, so keeping it brief: > > 1) The createuser and createdb commands I posted are to be run as the > "postgres" user. > 2) The user you create needs to be allowed to connect > (/etc/postgresql-???/pg_hba.conf ) I have left the default method "trust" in the pg_hba.conf and thought that this didn't even need a passwd, but as I explained above I had to explicitly set LOGIN rights for ROLE michael. It seems that I have some reading to do to freshen up on postgres including how to back up properly. Thanks again Joost, my kmail2 still seems to be functioning properly and without any major problems so far. :-) -- Regards, Mick
signature.asc
Description: This is a digitally signed message part.