1
我創建使用數據庫:插入BLOB類型圖像MySQL數據庫
create table test.data(
id int not null,
description varchar(255),
image blob not null,
primary key (id)
);
這個工作。然後,我嘗試使用將數據插入到表:
insert into test.data
values(1, "Image one", LOAD_FILE('D:\Ecommerce\site\image1.jpg'));
但我結束了一個錯誤,說column 'image' cannot be null
我如何可以將圖像到MySQL數據庫?我正在使用MySQL查詢瀏覽器和Windows 8.1。
雙重逸出文件路徑中的斜槓有效。 (..... load_file('C:\\ Users \\ Public \\ Pictures \\ image1.jpg'));)謝謝 – KMA 2015-04-02 01:18:48