pg_nf - this file is used to identify clients over the ident protocol.In this file, you can set different restrictions for your users or set a database connection policy pg_hba.conf - a file containing access settings. Postgresql configuration files are located in / var/lib/pgsql/11/data: Setting Main PostgreSQL Configuration Parameters It is similar to PhpMyAdmin that many web developers are familiar with. We’ll note that to manage PostgreSQL databases from a web interface more conveniently, it is recommended to use pgAdmin4 (written on Python and Javascript/jQuery). To get the information about the current session:Īs you have noticed, the syntax is similar to MariaDB or MySQL. Postgres=# select pg_terminate_backend(pid) from pg_stat_activity where datname = 'dbname' To reset all connections to the database: Postgres=# select * from pg_stat_activity where datname='dbname' To display the list of database connections: Postgres=# GRANT ALL PRIVILEGES ON DATABASE newdbtest TO mydbuser Postgres=# CREATE USER mydbuser WITH password '!123456789' Then we’ll show some simple examples of PostgreSQL management from psql console.Ĭhange the default postgres user password:ĪLTER ROLE postgres WITH PASSWORD 's3tPa$$w0rd!' Ĭreate a new database and user, and grant the user full access to the new database: # firewall-cmd -zone=public -add-port=5432/tcp -permanent If you want to access to PostgreSQL from the outside, open the TCP Port 5432 in the default CentOS firewalld: Oct 18 16:02:16 systemd: Starting PostgreSQL 11 database server. └─8728 postgres: logical replication launcher Process: 8714 ExecStartPre=/usr/pgsql-11/bin/postgresql-11-check-db-dir $ (code=exited, status=0/SUCCESS)ĬGroup: /system.slice/rvice Loaded: loaded (/usr/lib/systemd/system/rvice enabled vendor preset: disabled)Īctive: active (running) since Wed 16:02:15 +06 26s ago Also, enable the PostgreSQL daemon and add it to auto-start using systemctl:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |