Question

Is it possible to completely disallow certain charsets in MySQL and force an error and/or force everything into the server's chosen default charset?

Was it helpful?

Solution

Sessions can negotiate its own character set (SET names). That was a problem because, at least for some time, the PHP connector selected its own character set disregarding the MySQL server preferred one (default_character_set).

There are several things that people have done to handle that. If possible, fix the client configuration or enforce it on connection. That is the preferred method. Other people have decided to let the client take control of the encoding -Wikipedia does that, storing everything into blobs, but they had very specific requirements, I would not recommend it in general.

If you really want to go in your direction, you must recompile MySQL with the chosen -DDEFAULT_CHARSET and -DWITH_EXTRA_CHARSETS=none.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top