Karptonite
Karptonite

Reputation: 1632

Bypassing SET NAMES UTF8 for MySQL

The mysql manual says that SET NAMES 'x' is equivalent to

SET character_set_client = x; 
SET character_set_results=x; 
SET character_set_connection=x;

According to my config file for SERVER variables, I have all three of these set to utf8.

However, if I actually do a SHOW VARIABLES %character_set%, it shows the wrong character sets for connection, client, results, and server. This means I have to use the SET NAMES command for each connection.

I'm obviously doing something wrong, probably something simple, but it's got me stumped. Any ideas?

Upvotes: 2

Views: 563

Answers (2)

Karsten
Karsten

Reputation: 14642

Maybe your mysql module/connection defaults to another character set?

Upvotes: 0

Karptonite
Karptonite

Reputation: 1632

So I've found an answer--for some reason, I had to set: skip-character-set-client-handshake

I'm not sure why, but it works now.

Upvotes: 3

Related Questions