mirror of
https://pagure.io/fedora-docs/quick-docs.git
synced 2024-11-24 21:35:17 +00:00
Update modules/ROOT/pages/postgresql.adoc
This commit is contained in:
parent
9041b5d10e
commit
a33caf7cf3
1 changed files with 4 additions and 22 deletions
|
@ -4,9 +4,9 @@
|
||||||
== Installation
|
== Installation
|
||||||
|
|
||||||
The installation and initialization of the postgresql server is a little
|
The installation and initialization of the postgresql server is a little
|
||||||
bit different in comparison to other packages and other linux distros.
|
bit different in comparison to other packages and other Linux distros.
|
||||||
This document aims to summarize basic installation steps relevant to
|
This document aims to summarize basic installation steps relevant to
|
||||||
recent fedora release.
|
recent Fedora Linux Releases.
|
||||||
|
|
||||||
....
|
....
|
||||||
sudo dnf install postgresql-server postgresql-contrib
|
sudo dnf install postgresql-server postgresql-contrib
|
||||||
|
@ -35,17 +35,10 @@ sudo systemctl start postgresql
|
||||||
[[user-creation-and-database-creation]]
|
[[user-creation-and-database-creation]]
|
||||||
== User Creation and Database Creation
|
== User Creation and Database Creation
|
||||||
|
|
||||||
Now you need to create a user and database for the user.
|
Now you need to create a user and database for the user. This needs to be run from a `postgres` user account on your system.
|
||||||
First, you have to switch the user to interact with `postgres`:
|
|
||||||
|
|
||||||
....
|
....
|
||||||
su - postgres
|
sudo -u postgres psql
|
||||||
....
|
|
||||||
|
|
||||||
and then run postgres' interactive shell:
|
|
||||||
|
|
||||||
....
|
|
||||||
psql
|
|
||||||
....
|
....
|
||||||
|
|
||||||
From here you can create a postgres user and database. Note: you can also run this from the shell as well with `createuser lenny` and `createdb --owner=lenny carl`.
|
From here you can create a postgres user and database. Note: you can also run this from the shell as well with `createuser lenny` and `createdb --owner=lenny carl`.
|
||||||
|
@ -62,17 +55,6 @@ It might be good idea to add password for the `postgres` user while you're at it
|
||||||
postgres=# \password postgres
|
postgres=# \password postgres
|
||||||
....
|
....
|
||||||
|
|
||||||
Now get out of postgres and back to shell.
|
|
||||||
....
|
|
||||||
\q
|
|
||||||
....
|
|
||||||
|
|
||||||
And switch back to your main account with ctrl + D or type the command below where original_user is your username.
|
|
||||||
|
|
||||||
....
|
|
||||||
su your_username
|
|
||||||
....
|
|
||||||
|
|
||||||
Now you can access your database and start using it.
|
Now you can access your database and start using it.
|
||||||
|
|
||||||
....
|
....
|
||||||
|
|
Loading…
Reference in a new issue