load 38000 images into MYSQL...

This is a discussion on load 38000 images into MYSQL... within the MySQL Database forums, part of the Database Forums category; Hello ... I have a problem.......I want to load 38000 images into MYSQL...How can I do that???can u ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-14-2006
leen
 
Posts: n/a
Default load 38000 images into MYSQL...


Hello ...
I have a problem.......I want to load 38000 images into MYSQL...How can
I do that???can u help me.....actually..i have to create a database for
the employee for my company..I have to load all the images according to
their ID number....Can I do that in MYSQL becoz before this I have
tried it in access..but access only limited to 2GB data only....The
size for the images are about 5 GB. So now I want to do it in
MYSQL.....Plz help me.......

Reply With Quote
  #2 (permalink)  
Old 09-14-2006
Bill Karwin
 
Posts: n/a
Default Re: load 38000 images into MYSQL...

leen wrote:
> I want to load 38000 images into MYSQL...


You need to use a BLOB or MEDIUMBLOB datatype for the column storing
images. See http://dev.mysql.com/doc/refman/5.0/en/blob.html

It sounds like your average image size is 138KB (5GB / 38000).
I would recommend MEDIUMBLOB. A BLOB maximum size is 64KB. A
MEDIUMBLOB has a maximum size of 16MB, which should be enough for any image.

You can load the contents of a file into a field using the LOAD_FILE()
function. See docs for LOAD_FILE() at
http://dev.mysql.com/doc/refman/5.0/...functions.html
There's even an example of loading an image file in an UPDATE statement.

For example:

INSERT INTO images_table (id, image_data)
VALUES (1234, LOAD_FILE('/path/to/image_file.jpg');

It would probably be best to write a script to generate your 38000
INSERT statements needed to load all those files.

Regards,
Bill K.
Reply With Quote
  #3 (permalink)  
Old 09-14-2006
strawberry
 
Posts: n/a
Default Re: load 38000 images into MYSQL...


leen wrote:
> Hello ...
> I have a problem.......I want to load 38000 images into MYSQL...How can
> I do that???can u help me.....actually..i have to create a database for
> the employee for my company..I have to load all the images according to
> their ID number....Can I do that in MYSQL becoz before this I have
> tried it in access..but access only limited to 2GB data only....The
> size for the images are about 5 GB. So now I want to do it in
> MYSQL.....Plz help me.......


Unless there was a very good reason (data replication perhaps?) I
wouldn't store the images in the DB (just think about the back-ups!).
Instead I'd just store the path to the images. There's lots of
discussion out there on the pros and cons of both approaches, as well
as tutorials on exactly this kind of thing - including the construction
of thumbnails on the fly and even 1 or 2 completely free and excellent
php/mysql gallery packages.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:29 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0