当前位置:   article > 正文

KingbaseV8R6登录输入密码提示password authentication failed_ksql: error: could not connect to server: fatal: p

ksql: error: could not connect to server: fatal: password authentication fai

问题描述:

登陆时输入的免密是正确的,但是提示用户密码错误。

ksql: 错误: could not connect to server: FATAL:  password authentication failed for user "user01"

原因:

sys_hba.conf 配置scram-sha-256 加密方式,

数据库加密方式为md5,

  1. test=# show password_encryption ;
  2. password_encryption
  3. ---------------------
  4. md5
  5. (1 行记录)

登录的用户密码加密方式也是md5

  1. test=# select rolname,rolpassword from sys_authid where rolname='user01';
  2. rolname |             rolpassword
  3. ---------+-------------------------------------
  4. user01  | md52ee7e038c50f7aa237809ee6b0f3b06f
  5. (1 行记录)

处理:

修改password_encryption参数

  1. test=# alter system set password_encryption = 'scram-sha-256';
  2. ALTER SYSTEM
  3. test=# select sys_reload_conf();
  4. sys_reload_conf
  5. -----------------
  6. t
  7. (1 行记录)

修改用户密码:

  1. test=# alter user user01 with password '12345678ab'
  2. test-# ;
  3. ALTER ROLE
  4. test=# select rolname,rolpassword from sys_authid where rolname='user01';
  5. rolname |                                                              rolpassword
  6. ---------+---------------------------------------------------------------------------------------------------------------------------------------
  7. user01  | SCRAM-SHA-256$4096:rslJ0r3MQh0DJzeOG23F2Q==$n7VDb9fFFB/ER5UEo3K8Qr5XB2Yzvqxmu5o3au8lmvA=:vBhL3TZIdUHh3cdlHxAzhQfOJlmZt5KjVJGVTwN67bE=
  8. (1 行记录)

验证:

  1. [kingbase@kops data]$ ksql test user01
  2. 用户 user01 的口令:
  3. 输入 "help" 来获取帮助信息.
  4. test=>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/913954
推荐阅读
相关标签
  

闽ICP备14008679号