![]() ![]() Md5 is the most secure and recommended because it requires the client to supply a double-MD5-hashed password for authentication. PostgreSQL uses many types of client authentication methods including peer, ident, password, and md5 (read the PostgreSQL 12 documentation for a detailed explanation of each method). $ sudo vim /etc/postgresql/12/main/pg_hba.conf Open this file using your favorite text editor as shown. PostgreSQL uses client authentication to decide which user accounts can connect to which databases from which hosts and this is controlled by settings in the client authentication configuration file, which on Ubuntu is located at /etc/postgresql/12/main/pg_hba.conf. Postgres=# GRANT ALL PRIVILEGES ON DATABASE tecmintdb to tecmint Ĭreate a Database in PostgreSQL Configuring PostgreSQL Client Authentication postgres=# CREATE USER tecmint WITH PASSWORD CREATE DATABASE tecmintdb Now create a new database and a user using the following commands. First, switch to the postgres system user account and run the psql command as follows: $ sudo su - postgres To create a new database in PostgreSQL, you need to access the PostgreSQL database shell (psql) program. PostgreSQL Accepting Client Connections Creating Database in PostgreSQL ![]() After PostgreSQL installed, you can confirm that the PostgreSQL service is active, running and is enabled under systemd using the following systemctl commands: $ sudo systemctl is-active postgresqlĪlso, confirm that the Postgresql server is ready to accept connections from clients as follows: $ sudo pg_isready
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |