0

我正在使用 AES_ENCRYPT 方法来加密 Mysql 数据,但是当我尝试它用于 Mysql 日期类型字段时,它不起作用。如何使用 AES_ENCRYPT 加密 Mysql 日期字段?我已经通过谷歌搜索它但到目前为止没有运气。

4

1 回答 1

1

从mysql手册:

AES_ENCRYPT() encrypts a string and returns a binary string. 
AES_DECRYPT() decrypts the encrypted string and returns the original string. 
The input arguments may be any length. 
If either argument is NULL, the result of this function is also NULL. 

这意味着您需要将加密数据存储在 varchar 或 text 类型的列中。

于 2012-11-29T11:58:15.097 回答