MySQL blob: how to get just a subset of the stored data

后端 未结 3 1236
一个人的身影
一个人的身影 2021-01-27 05:10

I would like to use MYSQL as a storage system for a huge number of files. I would like to read/write just a portion of the data stored in a column (data is stored as bytes) so I

3条回答
  •  臣服心动
    2021-01-27 05:43

    You can try this approach. Store the meta data of your files (like path, name, etc.) in the database and store the files under a directory. From the database you can fetch the filepath and the read the file in random access mode. Using the file-offset you can get the required subset of the stored data.

提交回复
热议问题