如何在MySQL中存储varbinary? [英] How to store varbinary in MySQL?

查看:757
本文介绍了如何在MySQL中存储varbinary?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题.

在下面提到的两个选项中,如何存储到MySQL中的varbinary列?

Out of two options mentioned below, how to store to varbinary column in MySQL?

public_key = '67498930589635764678356756719'

public_key = 67498930589635764678356756719

第二种方法会起作用吗?我正处于生产服务器上的紧急时刻,不想对此进行试验.

Will the second method work? I am into an emergency moment working on a production server and didn't want to experiment on it.

谢谢您的帮助.

推荐答案

可打印数据可以使用引号插入.不可打印的数据可以使用十六进制值插入.即:

Printable data can be inserted using quotes. Non-printable data can be inserted using hexadecimal values. I.e.:

INSERT INTO Table(VarBinaryColumn) VALUES('Printable data') -- Will be stored as binary representation using the charset of the operating system

INSERT INTO Table(VarBinaryColumn) VALUES(0x12345) -- Non-printable binary data

这篇关于如何在MySQL中存储varbinary?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆