测试创建用户:
create user enmo identified by “GaussdB1”;
conn sys/GaussdB1@127.0.0.1:1888
1、密码规则:
当用户创建不符合密码规则,则会给出报错信息。下面的信息中可以看出有几个密码必须满足的规则要求。
GS-00657, Password is too simple, password should contain at least three of the following character types:
A. at least one lowercase letter
B. at least one uppercase letter
C. at least one digit
D. at least one special character: ~!@#$%^&*()-_=+\|[{}]:'",<.>/? and space
2、密码长度限制
以及密码长度不够也会给出报错,至少8个字符,最长是64个字符:
GS-00658, The password was invalid: password can’t be less than min length characters’
GS-00601, [1:30]Sql syntax error: text is too long, max is 64
3、zsql登陆,感叹号! ` ’ " / * ( ) $ \ | < >不可以用在密码里,但是在SQL>方式可以登陆。
以下是测试的案例:
SQL> ALTER USER SYS IDENTIFIED BY “G1`~!@#$%^&*()-_=+|[{}]:’,<.>/?g” ;
Succeed.
以下方式可以连接:
conn sys/G1`~!@#$%^&*()-_=+|[{}]:’,<.>/?g@127.0.0.1:1888
通过操作系统命令则无法连接:
[omm@localhost cfg]$ zsql sys/"G1`~!@#%^&*()-_=+\|[{}]:',<.>/?g"@127.0.0.1:1888
-bash: !@#%^: event not found
加上双引号也不行:
[omm@localhost cfg]$ zsql sys/"G1`~!@#%^&*()-_=+\|[{}]:',<.>/?g"@127.0.0.1:1888
-bash: !@#%^: event not found
通过每个符号测试得出结论:
! ` ’ " / * ( ) $ \ | < > 这些符号(感叹号,重音符,单引号,双引号,斜杠等等)如果用到密码中,则从操作系统zsql无法连接数据库,用sql命令航connect是可以连接数据库的。
4、白名单
SQL> conn enmo/enmo123!@192.168.101.111:1888
Warning: SSL connection to server without CA certificate is insecure. Continue anyway? (y/n):y
GS-00331, Whitelist rejects connection for user “ENMO”, ip “192.168.101.111”, current date “2020-01-10 01:29:45.705”, please check zhba.conf or tcp valid node configuration
白名单设置: