MYSQL AES 加密

MYSQL AES 加密,第1张

使用mysql的加密函数运行:

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加密结果一致,只是大小写差异。

1.mysqladmin -uxxx -p password "newpassword"

这个方法win下不好用

2.进入mysql后

set password for '用户名'@'hostname' identified by 'newpassword'

3.进入mysql后

grant usage on *.* to '用户名'@'hostname' identified by 'newpassword'

4.修改user表

use mysql

update user set password=password('newpassword') where user='xxxx'


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5943799.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-09
下一篇 2023-03-09

发表评论

登录后才能评论

评论列表(0条)

保存