简体   繁体   English

从MySQL DB删除Blob

[英]deleting a blob from MySQL DB

1) What is the best way to store many images in a MySQL database? 1)在MySQL数据库中存储许多图像的最佳方法是什么?

2) how the heck do you delete a blob in a MySQL DB after uploading one? 2)上传后,如何删除MySQL DB中的Blob?

Thanks 谢谢

For Storing Images : 用于存储图像:

Personally I suggest you have an image folder, and simply store the image paths in the DB. 我个人建议您有一个图像文件夹,并将图像路径简单地存储在数据库中。 That way all you do is retrieve a path and pass it to your image container, whatever it may be. 这样,您要做的就是检索路径并将其传递到图像容器,无论它是什么。

Don't store images in a database. 不要将图像存储在数据库中。 Maintenance of images becomes exceedingly complex, and the size of the db tends to be unnecessarily large. 图像的维护变得极其复杂,db的大小往往会变得不必要地大。

You also require extra code to to get back the image data, and display it back to the viewer. 您还需要额外的代码来取回图像数据,并将其显示回查看器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM