赞
踩
问题描述:
登陆时输入的免密是正确的,但是提示用户密码错误。
ksql: 错误: could not connect to server: FATAL: password authentication failed for user "user01"
原因:
sys_hba.conf 配置scram-sha-256 加密方式,
数据库加密方式为md5,
- test=# show password_encryption ;
- password_encryption
- ---------------------
- md5
- (1 行记录)
登录的用户密码加密方式也是md5
- test=# select rolname,rolpassword from sys_authid where rolname='user01';
- rolname | rolpassword
- ---------+-------------------------------------
- user01 | md52ee7e038c50f7aa237809ee6b0f3b06f
- (1 行记录)
处理:
修改password_encryption参数
- test=# alter system set password_encryption = 'scram-sha-256';
- ALTER SYSTEM
- test=# select sys_reload_conf();
- sys_reload_conf
- -----------------
- t
- (1 行记录)
修改用户密码:
- test=# alter user user01 with password '12345678ab'
- test-# ;
- ALTER ROLE
- test=# select rolname,rolpassword from sys_authid where rolname='user01';
- rolname | rolpassword
- ---------+---------------------------------------------------------------------------------------------------------------------------------------
- user01 | SCRAM-SHA-256$4096:rslJ0r3MQh0DJzeOG23F2Q==$n7VDb9fFFB/ER5UEo3K8Qr5XB2Yzvqxmu5o3au8lmvA=:vBhL3TZIdUHh3cdlHxAzhQfOJlmZt5KjVJGVTwN67bE=
- (1 行记录)
验证:
- [kingbase@kops data]$ ksql test user01
- 用户 user01 的口令:
- 输入 "help" 来获取帮助信息.
- test=>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。