image(SQL Server)和longblob(MySQL)有什么区别?

时间:2022-06-21 13:23:54

SQL Server Image Table

SQL Server映像表

CREATE TABLE "SqlServerTable" (
    "id" INT NOT NULL,
    "image" IMAGE NOT NULL,
    PRIMARY KEY ("id")
);

MySQL Image Table

MySQL图像表

CREATE TABLE `MySqlTable` (
    `id` INT NOT NULL,
    `image` LONGBLOB NOT NULL,
    PRIMARY KEY (`id`)
);

What is the difference between image and longblob?

image和longblob有什么区别?

How can convert data from image type in SQL Server to blob type in MySQL?

如何将数据从SQL Server中的图像类型转换为MySQL中的blob类型?

When I copy data from SQL Server to MySQL, does not show any image with this file_put_contents('2xx.jpg',$MySqlTable['image']);?

当我将数据从SQL Server复制到MySQL时,不会显示任何带有此file_put_contents的图像('2xx.jpg',$ MySqlTable ['image']);?

I have do special processing on image type SQL Server?

我对图像类型SQL Server做了特殊处理?

1 个解决方案

#1


1  

BLOB in MySQL
BLOB values are treated as binary strings (byte strings). They have no character set, and sorting and comparison are based on the numeric values of the bytes in column values.
The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB. These differ only in the maximum length of the values they can hold.
MySQL Connector/ODBC defines BLOB values as LONGVARBINARY.

MySQL中的BLOB BLOB值被视为二进制字符串(字节字符串)。它们没有字符集,排序和比较基于列值中字节的数值。四种BLOB类型是TINYBLOB,BLOB,MEDIUMBLOB和LONGBLOB。它们的区别仅在于它们可以容纳的值的最大长度。 MySQL Connector / ODBC将BLOB值定义为LONGVARBINARY。

image
Variable-length binary data from 0 through 2^31-1 (2,147,483,647) bytes.
image data type will be removed in a future version of Microsoft SQL Server. Use varbinary(max) instead.
Microsoft research: To BLOB or Not To BLOB

image 0到2 ^ 31-1(2,147,483,647)字节的可变长度二进制数据。将在Microsoft SQL Server的未来版本中删除图像数据类型。请改用varbinary(max)。微软研究:BLOB或BLOB

IMHO, both are a set of binary data and difference is about how each DBMS stores that set of binary data.
I think a better solution to avoid processing over images, streams and so on is to store URL File Links if there is not any advantage of using in table file data.

恕我直言,两者都是一组二进制数据,差异在于每个DBMS如何存储该组二进制数据。我认为避免处理图像,流等的更好的解决方案是存储URL文件链接,如果在表文件数据中没有任何使用优势的话。

#1


1  

BLOB in MySQL
BLOB values are treated as binary strings (byte strings). They have no character set, and sorting and comparison are based on the numeric values of the bytes in column values.
The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB. These differ only in the maximum length of the values they can hold.
MySQL Connector/ODBC defines BLOB values as LONGVARBINARY.

MySQL中的BLOB BLOB值被视为二进制字符串(字节字符串)。它们没有字符集,排序和比较基于列值中字节的数值。四种BLOB类型是TINYBLOB,BLOB,MEDIUMBLOB和LONGBLOB。它们的区别仅在于它们可以容纳的值的最大长度。 MySQL Connector / ODBC将BLOB值定义为LONGVARBINARY。

image
Variable-length binary data from 0 through 2^31-1 (2,147,483,647) bytes.
image data type will be removed in a future version of Microsoft SQL Server. Use varbinary(max) instead.
Microsoft research: To BLOB or Not To BLOB

image 0到2 ^ 31-1(2,147,483,647)字节的可变长度二进制数据。将在Microsoft SQL Server的未来版本中删除图像数据类型。请改用varbinary(max)。微软研究:BLOB或BLOB

IMHO, both are a set of binary data and difference is about how each DBMS stores that set of binary data.
I think a better solution to avoid processing over images, streams and so on is to store URL File Links if there is not any advantage of using in table file data.

恕我直言,两者都是一组二进制数据,差异在于每个DBMS如何存储该组二进制数据。我认为避免处理图像,流等的更好的解决方案是存储URL文件链接,如果在表文件数据中没有任何使用优势的话。