Reputation: 1
I have approximately 4 GB(34,000) of JPEG files that I need to store in MySQL table. Each image is of different date varying from 1-jan-1961 to 31-dec-2007. How should I store these files such that when I enter the specific date between this time interval the corresponding image appears in my localhost server. The MySQL table has following schema ID, date(that is being entered by the user end), file name, type, size.Is there any way I can upload these files(images) in chunk and not one by one.
Upvotes: 0
Views: 1515
Reputation: 921
First, PHPMyAdmin is not a good choice for end-user GUI, it's preferably used as SQL Web client for DB developers and administrators.
Second, you should not use MySQL to store images, SQL manipulation of big data blobs is quite inefficient compared to direct filesystem access. This point has been debated many times on this site :
You should instead :
Hope it helps.
Upvotes: 0
Reputation: 515
Always use mySQL client to do the bulk uploads, You can use the native mysql client or a PHP client. However all these years i didn't have to save a image in MySQL. It is hard to manage and have bad effect on the DB performance.
I recommend you to keep only a file URL in the database and have the files elsewhere, it can be local or some other image host. However with this you need to take care of some stuff of your own
If you can manage with your code, I suggest you to move your images out form the database
Upvotes: 1