3

I have a MySQL database hosted on a windows server. When I query for a particular record from various windows machines using mysql console I get Päivi (incorrect). When I query for the same record from various *nix machines using mysql console I get Päivi (correct). The query I'm using is a simple SELECT firstname FROM users WHERE id = 12345;.

My database collation is utf8, the field collation is utf8, and I've tried using set names 'utf8'; prior to running my queries.

Why would the windows machines return a different result? Could windows be missing certain characters? Is this normal/expected behavior? I'm not an encoding nor language expert so any feedback would be helpful.

2
  • How are you interacting with the servers? Mysql command line, MySQL Workbench, PHPMyAdmin? Commented Nov 16, 2011 at 20:27
  • @Traroth All my queries were performed via mysql console. I figured it removed the most variables (as opposed to looking at it through PHPMyAdmin where PHP could possibly munge it up) Commented Nov 16, 2011 at 20:30

2 Answers 2

3

After you connect to the server, from the MySQL console client, type the following command to view your current client characterset:

status;

To set it, use the following command:

set names latin1;
Sign up to request clarification or add additional context in comments.

3 Comments

Server, Db, Client, and Conn. are all set to utf8 charsets. Isn't that what I want?
See what it is on the *nix servers and set it the same.
The client was set to latin on the linux installs. Thanks!
0

I'm not sure if a windows console is still multi-byte using the ANSI code page. If so that would be the problem. The results might be correct but the console displays them incorrectly.

Comments

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.