select HEX(AES_ENCRYPT( 'test aes encrypt','123')) as aesTest
输出密文:
17CDAE577C715A0B5A922BF07462622AF15884B6D0F596B0241DC8F966C4A93F
https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_aes-encrypt
官方文档解释:
The block_encryption_mode system variable controls the mode for block-based encryption algorithms. Its default value is <font color="red"> aes-128-ecb </font>, which signifies encryption using a key length of 128 bits and ECB mode. For a description of the permitted values of this variable, see Section 5.1.8, “Server System Variables” .
在线加密验证 : http://tool.chacuo.net/cryptaes
该网加密结果为:
17cdae577c715a0b5a922bf07462622af15884b6d0f596b0241dc8f966c4a93f
与mysql加密结果一致,只是大小写差异。
原因:mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则改为caching_sha2_password解决办法:
1、升级客户端
2、把mysql用户登录密码加密规则还原成mysql_native_password:
ALTER USER xxxx IDENTIFIED WITH mysql_native_password BY '新密码'
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)