mysql 二进制的读取与写入

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

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



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

select id, cast(bin as char) as bintext from mytable

 

posted @ 2020-05-09 23:17  陈彦斌  阅读(1285)  评论(0编辑  收藏  举报