Can images be stored using MySQL database?

Ubuntu

Professional Slag
Apr 2, 2015
142
11
Is it possible? I'm wanting to create an image hosting website but I only got 5TB to work with, that may sound alot but it's used up in no time trust me, so I want some other way to store my images and maybe they could be rendered back to a jpg or other image file type when the user wants it?
 

Adil

DevBest CEO
May 28, 2011
1,278
716
You can, via MySQL's LONGBLOB datatype. However, this isn't recommended; store images in directories and then store a link/reference to the image in your database.


 

Adil

DevBest CEO
May 28, 2011
1,278
716
It'll take up the same amount of space (I think) in a database...
If you need to save space, compress the images before they're saved/uploaded.
 

GarettM

Posting Freak
Aug 5, 2010
833
136
I am a super noob so don't mind me but couldn't you convert the image to base64 then save the base64 string into the database then compress the image and save it in the directory that way you have a base64 image in the database and a compressed backup on disk. There has to be some kind of compression technique for images i have a desktop with a 1TB i don't use. You could use for testing
 

Users who are viewing this thread

Top