Hello.
Use DUMPFILE instead of OUTFILE. See: http://dev.mysql.com/doc/mysql/en/select.html jose nuno neto <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to use MySQL Blob columns to store files (docs,gifs,pdf.....) but > I'm getting corrupted files from the DB. > > the applications 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 > -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.NET http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Gleb Paharenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]