Hot answers tagged utf-8
2
The solution isn't precisely the same but this question is where I originally found direction for a similar issue and the concepts there should take you where you want to go. MySQL has a BINARY character set and from all appearances, by converting through it, you can prevent MySQL from realizing what you're actually doing and being "too helpful."
Test case ...
2
You could try turning on the general query log, which logs every query the server receives, and then use that information to see what's being queried, and then issue those queries yourself and examine the data.
To see the current setting for the general log (location and whether it's enabled):
mysql> SHOW VARIABLES LIKE 'general_log%'; # shows the ...
2
POLITICALLY CORRECT ANSWER
You cannot do MySQL Replication from a New Master to an Old Slave
I have written many posts about this:
Nov 26, 2012 : Replicate MySQL 5.0 Master to 5.5 Slave?
Feb 08, 2012 : will replication from 5.5.20 to 5.0.XX server work?
Dec 22, 2011 : What does the base64 BINLOG statements in mysqlbinlog output mean?
Feb 04, 2011 : MySQL ...
2
Opinion
It's probably better to throw an exception during your applications input checking and not pass the buck to the database.
Workaround
There is a "workaround" but your mileage may vary:
http://forge.mysql.com/worklog/task.php?id=3780
Brute Force?
You could convert your front end table VARCHAR field to a BLOB and store as binary data to cure the ...
1
How much data do you have? You could compare length and char_length of data values to return all the multibyte data, but if you have a ton of data, this will be too much to visually process.
Start with something like:
select [Column] from [Database].[Table] where length([Column]) != char_length([Column])
And use some OR statements in the where clause.
...
1
You need to ask the database from another angle. Please run this:
SHOW CREATE DATABASE mydb;
This will tell you what it sees. If you want to change the Character set and.or collation, do this:
ALTER DATABASE mydb ... ;
In mysql, ALTER DATABASE can change character set and/or collation. I have mentioned this in my past posts in the DBA StackExchange :
...
1
Think about it:
You are storing data in the database as latin1
You are data is handled internally by mysqld as latin1
If data coming from the OS or from the connection is utf8, how is mysqld going to treat it?
Rather than guessing or hoping for the best, you could change the incoming character set behavior. With the exception of information_schema and ...
1
After some trial and error, I've learned how and where to apply COLLATE:
Converted lines like:
SELECT SOMETHING
FROM SOMEWHERE
WHERE table_schema = given_database
AND table_name = given_table
AND index_name = given_index;
To:
SELECT SOMETHING
FROM SOMEWHERE
WHERE table_schema COLLATE utf8_unicode_ci = given_database
AND table_name COLLATE ...
Only top voted, non community-wiki answers of a minimum length are eligible