mysql 二进制的读取与写入

插入语句 用binary转换函数可将字符串转为二进制

insert into mytable (id, bin) values(1, binary('abcdef'))



查询语句 用cast进行类型转换

select id, cast(bin as char) as bintext from mytable
原文地址:https://www.cnblogs.com/chenyanbin/p/12861132.html