MySQL Variables collation_database 数据库 参数变量解释及正确配置使用

本站中文解释

collation_database是MySQL的一个参数变量,用来设置数据库字符集和排序规则。collation_database参数是可以在MySQL中使用ALTER DATABASE命令来设置的。这个collation_database参数确定了MySQL可以识别多种语言文字和文字排序规则,例如拉丁字母、汉字、日文和韩文等多种语言文字都可以被正确地识别和排序。设置collation_database参数时,可以设置具体的数据库字符集和排序规则,例如utf8格式的Unicode数据库字符集和本地化排序规则。如果在设置collation_database之前没有为数据库建立字符集,MySQL会默认地使用latin1类型的字符集和default排序规则。

官方英文解释

collation_database

System Variable collation_database
Scope Global, Session
Dynamic Yes
Type String
Default Value latin1_swedish_ci
Footnote This option is dynamic, but should be set only by server. You should not set this variable manually.

The collation used by the default database. The server sets
this variable whenever the default database changes. If there
is no default database, the variable has the same value as
collation_server.

The global
character_set_database and
collation_database system
variables are deprecated in MySQL 5.7; expect
them to be removed in a future version of MySQL.

Assigning a value to the session
character_set_database and
collation_database system
variables is deprecated in MySQL 5.7 and
assignments produce a warning. Expect the session variables to
become read only in a future version of MySQL and assignments
to produce an error, while remaining possible to access the
session variables to determine the database character set and
collation for the default database.


数据运维技术 » MySQL Variables collation_database 数据库 参数变量解释及正确配置使用