Importing a mysqldump with BLOBs

Hello,

I have a MySQL database which stores images as BLOBs. At present, the database is running on a Mac OS X host with MySQL 4.1.12 installed. I am trying to move the database to my Linode running Debian Sarge with MySQL 4.1.11.

I am using this command to dump the database:

$ mysqldump -uroot -p --opt gallery > dump.sql

And to import it on the Linode:

$ mysql -uroot -p --execute="create database gallery;"
$ mysql -uroot -p -e 'source dump.sql'

No errors are reported, but when I look at the images in the database, the appear corrupt (lots of ? characters).

I also tried just shutting down MySQL and copying the data directory over - same effect.

Any advice?

James.

3 Replies

How are you transferring dump.sql to your linode? Is something doing Windows->Unix line conversions on the data?

Andrew

@andrewjw:

How are you transferring dump.sql to your linode? Is something doing Windows->Unix line conversions on the data?

I'm just using scp to copy the dump directly from one server to the other - no text mangling involved.

For the record, if I transfer an 'ordinary' database, that is to say one without BLOBs, it imports with no problems.

James.

Well, turns out there was nothing wrong with the MySQL database - I missed a setting in php.ini. Oops!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct