List:MySQL on Win32« Previous MessageNext Message »
From:Guido Gloor Date:April 20 2011 12:43pm
Subject:Problem with binary Blobs upon dump / restore
View as plain text  
Hi all :)

I have a bit of a problem with a MySQL installation on a Win7 machine.
Technically, it's a 64-Bit installation, but hear me out.

I'm trying to access binary data that comes from a mysqldump on an Ubuntu
machine, which I'm fairly certain is running a 64 Bit mysqld, and it seems
that the data I get is corrupted if I access either the dump or the data
with a 32 Bit component. Because I'm using Ruby (and Rails), and Ruby is
only available as 32 Bit binary on Windows (and apparently, compiling 64 Bit
binaries is not a solved problem
yet<http://groups.google.com/group/rubyinstaller/browse_thread/thread/b628af0efaaae5bd/a50434c33b4634f8>),
I appear to be stuck with using the 32 Bit libmysql.dll. Attempting to
compile the 32 Bit Ruby components with a 64 Bit libmysql.dll leads to
failure, which I meanwhile realize should have been rather obvious to me
from the start (or am I mistaken?).

Now, what works is:

   - I can dump the data just fine on the Ubuntu machine, and get it back
   into working order both on a 64 Bit Windows mysqld and on a 64 Bit Mac
   mysqld.
   - I can retreive the data just fine when using a 64 Bit libmysql (on the
   Mac) from both the 64 Bit Windows mysqld and the 64 Bit Mac mysqld.

What doesn't work is:

   - I cannot get the dump back into working order on a 32 Bit Windows
   mysqld (if I try that, neither a 32 Bit libmysql nor a 64 Bit one will be
   able to retrieve the correct binary data).
   - I cannot retreive the binary data correctly with a 32 Bit libmysql,
   neither from the 64 Bit Windows mysqld nor the 64 Bit Mac one.

I verified that this works the same with both UTF8 and Latin1 encodings in
the dump, both explicit and (in the case of UTF8) implicit - I do not
believe that it is an encoding problem because the 64 Bit libmysql is able
to correctly retrieve data imported from the dump (no corrupted binary
files). I also checked it with both MySQL 5.1 and 5.5, recompiling the Ruby
accessor gem (and I tried both mysql and mysql2) between versions, and I get
exactly the same behaviour.

I am not extremely happy with using a 32 Bit libmysql to access a 64 Bit
mysqld, can that lead to problems? I do not think that it's the only problem
even if it can be one, as 32 Bit libmysql to 32 Bit mysqld does not work
properly, either (because the 32 Bit mysqld does not appear to be able to
properly import the 64 Bit mysqldump in the first place). Interestingly, the
64 Bit libmysql (but again, not the 32 Bit libmysql) is able to correctly
retrieve data from a 32 Bit mysqld if I do not let the 32 Bit mysqld import
the data, but copy the InnoDB data files over from a 64 Bit mysqld import.

Any ideas?

Cheers,
Guido Gloor

Thread
Problem with binary Blobs upon dump / restoreGuido Gloor20 Apr
  • RE: Problem with binary Blobs upon dump / restoreJorge Bastos20 Apr
Re: Problem with binary Blobs upon dump / restoreGuido Gloor27 Apr