As you can see, there are many reasons to use / why not use a database to store images. Personally, I prefer not to use a database to store files (images, documents, etc.), unless I am ordered to store them.
- Sometimes you get tired and fasten the request, something like "SELECT * FROM images", this will kill the server if the database contains too many images with a huge size (2 MB or more). - Security issue: you can still save files to disk and still be safe, how? Save files well outside the web directory, whenever a file is requested, read the file and pass it to the user. -If you accidentally use MySQL: if your database got to a large one (say 2-3 GB) and you use shared hosting, good luck in creating a backup or trying to restore this image database.
This is just my point.
source share