日期:2014-05-16  浏览次数:20693 次

mysql怎么加密密码?
最近密码泄露事件很轰动,我是用插入的SQL语句写入mysql的,明文保存密码!新闻说可以密文保存密码?请问密文保存完整的SQL语句是什么?请教,谢谢。

------解决方案--------------------
引用MD5(str)

Calculates an MD5 128-bit checksum for the string. The value is returned as a binary string of 32 hex digits, or NULL if the argument was NULL. The return value can, for example, be used as a hash key.

mysql> SELECT MD5('testing');
-> 'ae2b1fca515949e5d54fb22b8ed95575'

This is the “RSA Data Security, Inc. MD5 Message-Digest Algorithm.”