需要保存加密结果的字段为BLOB类型;
如下:
CREATE TABLE `tet` (
`title` blob,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
INSERT INTO tet(title) VALUES(ENCODE('数对密码字段进行','abc'));
SELECT * FROM tet;
SELECT DECODE(title,'abc') from tet;
本人在linux上运行结果正常。仅供参考
试试这个语句
alter table userlog MODIFY `password` char(128) CHARACTER SET binary;这样就行了