BLOB Files retreive error
Posted by:
jose neto
Date: August 10, 2005 10:30AM
Hi,
i'm trying to use MySQL Blob columns to store files (docs,gifs,pdf.....) but I'm getting currepted files from the DB.
the aplications runs php, loading file content with addslashes but in order to spot the error i've tried it with mysql only like this:
column file is a MEDIUMBLOB
INSERT INTO XXXXXX SET file=LOAD_FILE("/tmp/teste.pdf");
and them
SELECT file INTO OUTFILE "/tmp/teste_frommysql.pdf" FROM XXXXXX WHERE id=12;
and teste_frommysql.pdf cant be loaded
ls -l shoes that the sizes are different:
270713 Aug 2 11:28 /tmp/teste.pdf (ORIGINAL)
277405 Aug 10 17:21 /tmp/teste_frommysql.pdf
I've made a test with a text file and noticed that the file from MySQL has a added LineBreak at the end.Is thta the problem? how can I fix this?
This is my config:
Linux 2.6.11-1.1369_FC4
mysql-server-4.1.11-2
mysql-4.1.11-2
cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
[mysql.server]
user=mysql
basedir=/var/lib
[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
key_buffer_size=64M
table_cache=256
sort_buffer_size=4M
read_buffer_size=1M
Subject
Written By
Posted
BLOB Files retreive error
August 10, 2005 10:30AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.