Error on updating a field with binary values I have a problem on emoji showing on webpage after migration to new DB Server. But I have a workaround. I will get the binary values of a certain field of TABLE1 on our OLD DB Server. Then update the TABLE1 on the new server using the script below:
UPDATE old_table t1 INNER JOIN new_table t2 ON t1.id = t2.id
SET t2.message = CAST(CONCAT(&quot;0x&quot;,HEX(t1.message)) AS BINARY);

But after executing this my message field on the new table becomes &quot;0x1E395565&quot;
If I do this script below, it will show the real message. But doing this for a million of records will take too long to execute hence the UPDATE INNER JOIN:
UPDATE new_table SET message = 0x1E395565 where id =1;

How to update this correctly? I concat &quot;0x&quot; on the HEX(t1.message) because when I do a mysqldump --hex-blob and charset=BINARY. There are 0x on the values.
My data type for message field is VARCHAR(1000) I know this might be wrong but is there any workaround without altering the table.
Simply use UNHEX(&quot;1E395565&quot;).
There could be a lot of other issues going on.  So please provide SHOW CREATE TABLE for the old and new tables.  Also provide a sample of what is in the old table, but use
SELECT col, HEX(col) FROM ... WHERE ...

so we can see the value in an unambiguous way.  (That is, not mangled or &quot;fixed&quot; by the client.)
Where does 1E395565 come from?  It is not anything meaningful (not utf8, etc) that I recognize.