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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top