3

I am trying to copy a table from on MySQL database on a remote machine to another MySQL database on my local machine. I noticed that after importing the dump to my local machine, there were characters like ’ instead of single quotes.

I assumed this was an encoding issue, so I went into both databases and ran show create table posts, near the end of both, I saw CHARSET=utf8. Also, I ran file -i on the dump file, both before and after scping it to my local machine, and they were both utf8.

However, when I import this file, I get this before:

  attendees—policy makers, 

and after:

  attendees—policy makers,

I am not sure why this is happening, everything is using utf8, what am I missing?

EDIT: I am using mysql Ver 14.12 Distrib 5.0.75, for debian-linux-gnu (x86_64) remotely, and mysql Ver 14.14 Distrib 5.5.25a, for osx10.7 (i386) locally.

1
  • make sure that the mysql monitor is connecting with a utf-8 connection when you're loading up the dump. Commented Jul 17, 2012 at 17:55

1 Answer 1

5

On both systems you must check that your connection encoding is correct:

SHOW VARIABLES LIKE 'character_set_%'

Usually seeing characters like that is the result of double-encoding. Make sure you can match up the connection and client encoding to be exactly the same. There is a number of command line options that can facilitate this, or if you're using a driver or client, something in there can tweak it.

Sign up to request clarification or add additional context in comments.

1 Comment

The connection encoding appears to be latin1, this sounds like what @"Marc B" was suggesting, I'll see if I can change that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.