使用 blob 字段加载数据文件
鉴于我必须在短时间内转储大量插入,设法将所有记录转储到文件中,然后通过 mysql 的 load data infile 语句加载它们。这工作正常,但现在我将更多的值压缩到 blob 字段中以减少插入。问题是我找不到将 blob 字段转储到文件中的方法,以便在加载数据时插入正确的值。我尝试了不同的方法,但没有幸福的结局,并且想避免一一插入。
有谁知道如何正确执行此操作?
Given I have to dump a lot amount of inserts in a short period managed to dump all records to a file and then loading them by the load data infile sentence of mysql. This was working fine but now I compress a little more the values into a blob field to make less inserts. The problem is that I cant find a way to dump the blob field into the file so when loading data inserts the correct values. I've tried different ways but no happy ending and want to avoid inserting one by one.
Has anyone knows how to do this properly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 Blob 数据的 HEX() 字符串存储在文件中。
对于您的 SQL,请使用
SET
子句。例如:Store the HEX()'d string of your blob data in the file.
For your SQL, use the
SET
clause. For example: