PostgreSQL has the following 3 configuration files, which can be found using find.
If the normal user looks under the Linux folder, it may not be found because of insufficient permissions. You can use Find lookup from root.
[Email protected]/]# Find/-name pg_hba.conf
/var/lib/pgsql/10/data/pg_hba.conf,
postgres
ql vs mysql
# # POSTGRESQL.CONF Database related configuration (listening IP address and port, etc.)
# # PG_HBA.CONF Client Authentication configuration file postgresql download
# # PG_IDENT.CONF User mapping file if the client uses Ident type authentication, the mapping relationship here is needed.
For example, the server is known as User1 operating system users, and the database also has the same name of the database user, User1 log on to the operating system can be directly entered Psql, to User1 database users to log into the database and do not require a password. Many beginners will encounter psql-u username login database But "Username ident authentication failed" error, clearly the database user has createuser.
The reason for this is that the Ident authentication method is used, but there is no operating system user with the same name or no corresponding mapping user. Solution: 1, add the mapping user in pg_ident.conf, 2, change the authentication method.
CentOS7 after installing PostgreSQL10 and PGADMIN4, Pgadmin4 always logs on to the database prompting the user for authentication failure postgresql update.
It is because the default local authentication method of the Linux under PostgreSQL is ident, and the Pg_ident.cong user mapping file does not have any mapped users,
So you can modify the authentication method for MD5, can use the password successfully landed install postgresql.
The authentication types for the Pg_hba.conf client authentication profile include:
> Trust can log in directly to the server using Psql-u postgres (production environment is not used)
> peer can log in directly to the server using psql-h 127.0.0.1-d postgres-u postgres install postgresql ubuntu;
> Password login with user name password (clear text password); (production environment is not used)
> identident is the default local authentication method under the Linux PostgreSQL, the user who can log on to the server correctly (note: not a database user) can use this user mapping database users do not need a password to log into the database.
> md5md5 is a common password authentication method, if you do not use ident, it is best to use MD5. The password is transmitted to the database in the form of MD5, which is more secure and does not require an operating system user with the same name
> Reject Reject Certification
It is recommended to use the MD5 method, the same password encryption of different users results are not the same, because the user name and password are encrypted together. So note: If the user name of the password has changed, the password will be invalid ...
===========================
Https://www.cnblogs.com/hiloves/archive/2011/08/20/2147043.html
Https://pylixm.cc/posts/2017-11-05-postgresql-install.html
78622167
https://yq.aliyun.com/articles/79330
http://axiaoxin.com/article/121/
Configuration file for PostgreSQL