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