Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4032834
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:46:15+00:00 2026-05-20T11:46:15+00:00

I am migrating a MySQL 5.1 database in Amazon’s EC2, and I am having

  • 0

I am migrating a MySQL 5.1 database in Amazon’s EC2, and I am having issues tables with longblob datatype we use for image storage. Basically, after the migration, the data in the longblob column is a different size, due to the fact that the character encoding seems to be different.

First of all, here is an example of before and after the migration:

Old:

x??]]??}?_ѕ??d??i|w?%?????q$??+?

New:

x��]]����_ѕ��d��i|w�%�����q$��+�

I checked the character set variables on both machines and they are identical. I also checked the ‘show create table’ and they are identical as well. The client’s are both connecting the same way (no SET NAMES, or specifying character sets).

Here is the mysqldump command I used (I tried it without –hex-blob as well):

mysqldump --hex-blob --default-character-set=utf8 --tab=. DB_NAME

Here is how I loaded the data:

mysql DB_NAME --default-character-set=utf8 -e "LOAD DATA INFILE 'EXAMPLE.txt' INTO TABLE EXAMPLE;"

Here are the MySQL character set variables (identical):

Old:

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     | 
| character_set_connection | latin1                     | 
| character_set_database   | utf8                       | 
| character_set_filesystem | binary                     | 
| character_set_results    | latin1                     | 
| character_set_server     | latin1                     | 
| character_set_system     | utf8                       | 
| character_sets_dir       | /usr/share/mysql/charsets/ | 
+--------------------------+----------------------------+

New:

+--------------------------+----------------------------+    
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     | 
| character_set_connection | latin1                     | 
| character_set_database   | utf8                       | 
| character_set_filesystem | binary                     | 
| character_set_results    | latin1                     | 
| character_set_server     | latin1                     | 
| character_set_system     | utf8                       | 
| character_sets_dir       | /usr/share/mysql/charsets/ | 
+--------------------------+----------------------------+

I’m not sure what else to try to be able to run mysqldump and have the blob data be identical on both machines. Any tips would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:46:16+00:00Added an answer on May 20, 2026 at 11:46 am

    The issue seems to be a bug in mysql (http://bugs.mysql.com/bug.php?id=27724). The solution is to not use mysqldump, but to write your own SELECT INTO OUTFILE script for the tables that have blob data. Here is an example:

    SELECT
    COALESCE(column1, @nullval), 
    COALESCE(column2, @nullval), 
    COALESCE(HEX(column3), @nullval), 
    COALESCE(column4, @nullval), 
    COALESCE(column5, @nullval)
    FROM table
    INTO OUTFILE '/mnt/dump/table.txt' 
    FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n';
    

    To load the data:

    SET NAMES utf8;
    LOAD DATA INFILE '/mnt/dump/table.txt'
    INTO TABLE table
    FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'
    (column1, column1, @column1, column1, column1)
    SET data = UNHEX(@column1)
    

    This loads the blob data correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a hard time migrating my MySQL 4.1 database from old 16-byte
I used to use mysql, and in mysql database hold tables, but these concepts
I was migrating mysql database to postgres and stumbled across the following block in
i am migrating from ms access database to mysql database with java frontend so
I have a MySQL database that I am migrating to SQL Server. The application
I'm using PDO after migrating away from the mysql library. What do I use
For migrating my old database from MySQL to SQL Server, which edition is suitable,
I'm running a django system over mysql in amazon's cloud, and the database default
I am migrating a mysql database from one site to another. Its encodign: utf8
We're migrating MySQL to PostgreSQL. I can easily audit the schema and the SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.