Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些简短的二进制数据(最大 130 字节),将其存储在 mysql db 中的最佳方法是什么。首先想到的是 VARBINARY、BLOB,但如果我只是简单地进行 base64 编码并将结果字符串存储为 VARCHAR,那么又会出现什么问题。
我也面临你现在遇到的问题..
尝试 longblob 数据类型。它将允许存储多达 4 mb 我希望如此..
如果我只是做 base64 编码有什么问题
有 33% 的开销(即您需要至少 174 个字节来存储数据)并且搜索变得更加困难。OTOH 它可能会使用 SQL 编写查询更简单。