I have MySQL version 5.1.41 installed on Windows Server 2003.
I am unable to insert a blob file (any file) into MySQL.
For example, I created a database (named test) with one table (named testtable) and two fields:
no - an id field
image - a mediumblob field
(see creation sql code attached)
CREATE TABLE `testtable` (
`no` int(11) NOT NULL AUTO_INCREMENT,
`image` mediumblob NOT NULL,
PRIMARY KEY (`no`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
In phpMyAdmin, on the Insert tab, I try to insert a single record. I leave "no" blank because it is an auto-increment. I click on the "Choose File" button and select any file at all. I've been sticking with small files, in case size is an issue, but the problem seems to happen across all files & all file types that I've tested. So, for example, I've selected a very small png file. It shows the filename on the screen. Then I click the "Go" button to actually do the insert.
I get this error (also see screenshot)
INSERT INTO `test`.`testtable` (
#1364 - Field 'image' doesn't have a default value
As you can see, it isn't uploading the file at all, but has placed a NULL value instead of where the binary data should appear.
I'm not sure what might cause this issue. Any suggestions would be appreciated.