opengauss:none of the server’s SASL authentication mechanisms are supported

2024年 3月 4日 43.3k 0

新搭的opengauss连接报错:

处理办法:

1.postgresql.conf修改

password_encryption_type = 1

2.pg_hba.conf修改sha256改成md5

host all all 0.0.0.0/0 md5


3.重启openguass

su - omm
gs_om -t restart

没改密码的话,连接报错!

4.修改密码:

[omm@openGauss ~]$ gsql -d postgres -p 15400 -W xxx@ -r
gsql ((openGauss 5.0.1 build 33b035fd) compiled at 2023-12-15 20:19:06 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

openGauss=# alter user gistar identified by 'xxx@';
ERROR: New password should not equal to the old ones.
openGauss=# alter user gistar identified by 'xxx@1';
NOTICE: The encrypted password contains MD5 ciphertext, which is not secure.
ALTER ROLE
openGauss=# alter user gistar identified by 'xxx@';
ERROR: The password cannot be reused.

相关参考:
https://blog.csdn.net/mm8413/article/details/125826973

操作日志如下:


[root@openGauss dn]# pwd
/opt/huawei/install/data/dn
[root@openGauss dn]# vi postgresql.conf
[root@openGauss dn]# grep password_encryption_type postgresql.conf
password_encryption_type = 1 #Password storage type, 0 is md5 for PG, 1 is sha256 + md5, 2 is sha256 only
[root@openGauss dn]# vi pg_hba.conf
#
# When you configure this file, please configure it from top to bottom,
# higher priority needs to be configured in front.

# CAUTION: Configuring the system for local "trust" authentication
# allows any local user to connect as any PostgreSQL user, including
# the database sysadmin. If you do not trust all your local users,
# use another authentication method.

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
host all omm 192.168.207.194/32 trust
#host all all 0.0.0.0/0 trust
# IPv4 local connections:
#host all all 127.0.0.1/32 trust
#host all all 192.168.207.194/16 sha256
#host all all 0.0.0.0/0 sha256
host all all 0.0.0.0/0 md5

# IPv6 local connections:
host all all ::1/128 trust
host all all 0.0.0.0/0 sha256
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication omm trust
#host replication omm 127.0.0.1/32 trust
#host replication omm ::1/128 trust

[root@openGauss dn]# su - omm
Last login: Fri Mar 1 13:59:40 CST 2024 on pts/1
[omm@openGauss ~]$ gs_om -t restart
Stopping cluster.
=========================================
Successfully stopped cluster.
=========================================
End stop cluster.
Starting cluster.
=========================================
[SUCCESS] openGauss
2024-03-01 14:02:23.572 65e16f6f.1 [unknown] 140382251831616 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2024-03-01 14:02:23.572 65e16f6f.1 [unknown] 140382251831616 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2024-03-01 14:02:23.573 65e16f6f.1 [unknown] 140382251831616 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 Mbytes) or shared memory (4990 Mbytes) is larger.
=========================================
Successfully started.
[omm@openGauss ~]$ gsql -d postgres -p 15400 -W xxx@ -r
gsql ((openGauss 5.0.1 build 33b035fd) compiled at 2023-12-15 20:19:06 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

openGauss=# alter user gistar identified by 'xxx@';
ERROR: New password should not equal to the old ones.
openGauss=# alter user gistar identified by 'xxx@1';
NOTICE: The encrypted password contains MD5 ciphertext, which is not secure.
ALTER ROLE
openGauss=# alter user gistar identified by 'xxx@';
ERROR: The password cannot be reused.
openGauss=# q
[omm@openGauss ~]$
[omm@openGauss ~]$ exit
logout

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论