mysql clob blob,如何在MySQL中插入BLOB和CLOB文件?
I want to store images and .docx/.doc, .pptx/.ppt, .pdf files using the front end of my software. I don't understand how to implement this and how to insert the BLOB and CLOB files into the table. Please help.
I am using Kubuntu 11.04, MySQL5, Qt 4.7.3.
解決方案
Two ways:
1 - Use a LOAD_FILE function -
INSERT INTO table1 VALUES(1, LOAD_FILE('data.png'));
2 - Insert file as hex string, e.g. -
INSERT INTO table1 VALUES
(1, x'89504E470D0A1A0A0000000D494844520000001000000010080200000090916836000000017352474200AECE1CE90000000467414D410000B18F0BFC6105000000097048597300000EC300000EC301C76FA8640000001E49444154384F6350DAE843126220493550F1A80662426C349406472801006AC91F1040F796BD0000000049454E44AE426082');
總結
以上是生活随笔為你收集整理的mysql clob blob,如何在MySQL中插入BLOB和CLOB文件?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 阴和阳哪个更厉害
- 下一篇: mysql激活指令_MySQL命令大全