| title | ALTER DATABASE | TiDB SQL Statement Reference | ||
|---|---|---|---|
| summary | An overview of the usage of ALTER DATABASE for the TiDB database. | ||
| aliases |
|
ALTER DATABASE is used to specify or modify the default character set and collation of the current database. ALTER SCHEMA has the same effect as ALTER DATABASE.
AlterDatabaseStmt:
DatabaseOption:
ALTER {DATABASE | SCHEMA} [db_name]
alter_specification ...
alter_specification:
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_nameThe alter_specification option specifies the CHARACTER SET and COLLATE of a specified database. Currently, TiDB only supports some character sets and collations. See Character Set and Collation Support for details.
This statement is understood to be fully compatible with MySQL. Any compatibility differences should be reported via an issue on GitHub.

