store images using MySQL

I’m at a loss to understand Base’s behavior here. Please help. I have a database stored on a MySQL server. The database will contain several images and a long text field, as well as a few other small ones. The small ones all work fine, but when I try to use the form wizard it creates the input for the long text field as expecting an image. I can fix that by editing the form, deleting that control and putting a new text control in. But none of the images save! I can click on an image, and load it no problem (no comments about linking the image instead, for my purpose embedding the images is the ONLY way to get the task done correctly). But when I save the record, the images disappear. The text stays just fine, but not the images. What am I doing wrong? The image fields in the MySQL table are BLOB fields.

Any help is appreciated!

Maybe use an IMAGE CONTROL in your form to display a LINKED (local) image. If you try to store an image within the Base database file you are likely to have problems due to large file-sizes (with BLOB fields). See HERE for tips on how to do it. I guess your images would be located in a local folder next to your Base file. I presume the local path to each image is stored in the MySQL datafile. I am not sure if it’s possible to store all your images non-locally, on your MySQL server?

UPDATE: It would seem from THIS POST that storing a lot of images in a MySQL database is not advisable - better to store images in a separate folder on the server. If you do store images in a MySQL datbase, it would seem there is a 1MB limit (unless you tweek some MySQL settings). See my comment about LongBlob image storage below. If you are going to store your images in the MySQL database, HERE is some more information that might be relevant. Also see my COMMENT below.

I specifically said embedding the images in the database is the only way to to what I am trying to do. Linking will NOT work. I also said it was on a MySQL server. Only forms, reports and queries would be in the odb file so size will not be a problem.

Sorry about my misunderstanding - I am no expert on MySQL. It looks like some have had success previously with images on MySQL server database through LO using LongBlob - see HERE.

I see the message about that. So here’s a question. Is it possible to store the images as https references and have base import the images at run time? The main issue here is that this will be on a database file that could be accessed from anywhere and so just leaving them on the server somewhere as a file share is not practical. Now if I can store the references as https links and put the files on my web server, then that’s fine.

I recall at some point seeing a past post which uses a MACRO to open a URL stored in Base in an external web browser. Not sure if the IMAGE control in a form can use a URL to display an image. Maybe post a separate question. Sorry I can’t be more specific. THIS POST might be relevant. In theory, as long as your MySQL DB (and the LO Base config settings) ‘knows’ where to find the images on the server - your problem should be solved.

I finally found a workable solution. I changed the image fields from longblobs to varchar and put all the images on my web server in an unadvertised directory. Now I can just link the files from there. Not QUITE what I was looking for, but it works well enough.


My guess is that you are using a native connector. JDBC does work.