Databases Reference
In-Depth Information
Authentication plugins
Authentication plugins can work on the client or the server side to extend the range
of authentication mechanisms available to the server, including PAM and LDAP
authentication, for example.
For more details, see the MySQL manual, or read the topic MySQL 5.1 Plugin Devel-
opment by Sergei Golubchik and Andrew Hutchings (Packt). If you need a plugin and
don't know how to write one, many service providers have competent staff who can
help you, including Monty Program, Open Query, Percona, and SkySQL.
Character Sets and Collations
A character set is a mapping from binary encodings to a defined set of symbols; you
can think of it as how to represent a particular alphabet in bits. A collation is a set of
sorting rules for a character set. In MySQL 4.1 and later, every character-based value
can have a character set and a collation. 8 MySQL's support for character sets and col-
lations is very full-featured, but it can add complexity, and in some cases it has a per-
formance cost. (By the way, Drizzle discards it all and makes everything UTF-8, period.)
This section explains the settings and functionality you'll need for most situations. If
you need to know the more esoteric details, you should consult the MySQL manual.
How MySQL Uses Character Sets
Character sets can have several collations, and each character set has a default collation.
Collations belong to a particular character set and cannot be used with any other. You
use a character set and a collation together, so we'll refer to them collectively as a
character set from now on.
MySQL has a variety of options that control character sets. The options and the char-
acter sets are easy to confuse, so keep this distinction in mind: only character-based
values can truly “have” a character set. Everything else is just a setting that specifies
which character set to use for comparisons and other operations. A character-based
value can be the value stored in a column, a literal in a query, the result of an expression,
a user variable, and so on.
MySQL's settings can be divided into two classes: defaults for creating objects, and
settings that control how the server and the client communicate.
Defaults for creating objects
MySQL has a default character set and collation for the server, for each database, and
for each table. These form a hierarchy of defaults that influences the character set that's
8. MySQL 4.0 and earlier used a global setting for the entire server, and you could choose from among
several 8-bit character sets.
 
Search WWH ::




Custom Search