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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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....... |
|
|||
|
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. |
|
|||
|
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. |