在尺寸>的文件表格中的插页在本地网络外部16Mb,获得例外:
在本地网络中没有问题在大小>的文件表中插入16MB!
代码插入blob:
procedure TQueryThread.Execute;
begin
FMyConn := TMyConnection.Create(nil);
FMyConn.Server := IniParams.pServer;
FMyConn.Port := StrToInt(IniParams.pPort);
FMyConn.Database := IniParams.pDatabase;
FMyConn.Username := 'addressbook';
FMyConn.Password := 'su7Qcatw';
FMyConn.Connected := true;
qFileBlob := TMyQuery.Create(nil);
qFileBlob.Connection := FMyConn;
qFileBlob.SQL.Clear;
qFileBlob.SQL.Add('INSERT INTO attachment (address_id,file_blob,create_date,file_name,file_extension,description) values (:pAddressID,:pFileBlob,:pCreateDate,:pFileName,:pFileExtension,:pDescription)');
qFileBlob.ParamByName('pAddressID').AsInteger := FAddressID;
qFileBlob.ParamByName('pFileBlob').LoadFromFile(FName, ftBlob);
qFileBlob.ParamByName('pCreateDate').AsDate := FCreateDate;
qFileBlob.ParamByName('pFileName').AsString := ExtractFileName(FName);
qFileBlob.ParamByName('pFileExtension').AsString := ExtractFileExt(FName);
qFileBlob.ParamByName('pDescription').AsString := FDescription;
qFileBlob.Execute;
Synchronize(DisplayMessage);
end;
SHOW VARIABLES LIKE 'max_allowed_packet'
mysql> show variables like "max_allowed_pa
-> ;
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| max_allowed_packet | 524288000 |
+--------------------+-----------+