1、PASSWORD()
2、ENCODE(,) DECODE(,)
3、MD5()
4、SHA5()
5、AES_ENCRYPT AES_DECRYPT
加密 select aes_encrypt(name, 'password ');
解密 select aes_decrypt(aes_encrypt(name, 'password '), 'password ');
可用hex或base64转码(base64在mysql5.6及以上支持)
select hex(aes_encrypt('5656', 'zh'));
select aes_decrypt(unhex(hex(aes_encrypt('5656', 'zh'))), 'zh');
select to_base64(aes_encrypt('5656', 'zh'));
select aes_decrypt(from_base64(to_base64(aes_encrypt('5656', 'zh'))), 'zh');