开发者

Why data of digital image containing special characters?

I am unsuccessfully trying to restore a MySQL database from a dump file.

When an INSERT query is executed (from the dump file) to insert an image data, the MYSQL server reports error. This problem dosen't seem to be related to max-allowed-packet parameter (because I have extensively tested with various reasonable values for max-allowed-packet).

What I have noted is the image data in the dump file contains special characters as follows. According to my understanding a digital image should only contain zeros and ones. (The image from the original database is displayed as expected in the web application which uses the database)

I just copy here the image data from the dump file:

'‰PNG\r\n\Z\n\0\0\0\rIHDR\0\0\0P\0\0\0P\0\0\0开发者_如何学C¹ÏŸ\0\0\0tEXtSoftware\0Adobe ImageReadyqÉe<\0\0\03PLTEÿÿÿéLLñˆˆøÃÃâýððæ..úÒÒç==ûááïyyäíjjô¥¥ö´´ë[[ò––ð%ê\0\0ñIDATxÚì—Ý‚« .....


I think it's a problem of collation in the dump file. Try to merge all collations in the same (i think the better that you can use in this case is UTF8 or latin1 ci), but look up for this: collation for dump, insert into of the data, create table, database connection, software connection. There must be the same. After you do that, look up for the same problem, and you will get no error or the -real- error of the problem you really have.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜