开发者

Weird characters in table columns' values when importing sql dump with the source command

I was importing an SQL dump file using the source command (source sql_file_name) and afterwards there were a bunch of weird characters in the columns' values. For example: â¢. How do I fix it? I'm us开发者_JAVA技巧ing mysql 5.0.45. Thanks.


Probably someone used accented characters in the column names, which is always a bad idea.

When importing a file, MySQL needs to know in what encoding the file is. So you need to issue "SET NAMES utf8" before importing the file (or something else than utf8, just choose the right encoding).

If you don't use the correct encoding, your data will be screwed too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜