10.3.1. Server Character Set and Collation
MySQL Server has a server character set and a server collation.
These can be set at server startup and changed at runtime.
Initially, the server character set and collation depend on the
options that you use when you start mysqld.
You can use
--character-set-server for the
character set. Along with it, you can add
--collation-server for the collation. If you
don't specify a character set, that is the same as saying
--character-set-server=latin1. If you specify
only a character set (for example,
but not a collation, that is the same as saying
latin1_swedish_ci is the default collation
latin1. Therefore, the following three
commands all have the same effect:
mysqld --character-set-server=latin1 \
One way to change the settings is by recompiling. If you want to
change the default server character set and collation when
building from sources, use:
--with-collation as arguments for
configure. For example:
./configure --with-charset=latin1 \
Both mysqld and configure
verify that the character set/collation combination is valid. If
not, each program displays an error message and terminates.
The current server character set and collation can be determined
from the values of the
collation_server system variables. These
variables can be changed at runtime.