欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

varbinary mysql,如何在MySQL中存储varbinary?

发布时间:2023/12/10 46 豆豆
生活随笔 收集整理的这篇文章主要介绍了 varbinary mysql,如何在MySQL中存储varbinary? 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

Just a quick question..

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

public_key = '67498930589635764678356756719'

or

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.

Thank you for any help.

解决方案

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

总结

以上是生活随笔为你收集整理的varbinary mysql,如何在MySQL中存储varbinary?的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。