08/29: MySQL > Database Properties
Category: Study
Posted by: hajime osako
Each database directory has a default character set and collation. The properties are stored in a file named db.opt in the database directory.
MySQL does not place any limits on the number of databases.
In MySQL, the word "database" is same as "schema". So "SHOW SCHEMAS" instead of "SHOW DATABASES" is doable.
The CREATE/ALTER DATABASE statements have two optional clauses, CHARACTER SET and COLLATE.
Example:
CREATE DATABASE database_name CHARACTER SET utf8 COLLATE utf8_japanese_ci;
ALTER DATABASE (database_name) CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER DATABASE affects only creation of new tables. You cannot use ALTER DATABASE to rename a database.
Any warning generated when IF EXISTS is used can be displayed with SHOW WARNINGS.
MySQL does not place any limits on the number of databases.
In MySQL, the word "database" is same as "schema". So "SHOW SCHEMAS" instead of "SHOW DATABASES" is doable.
The CREATE/ALTER DATABASE statements have two optional clauses, CHARACTER SET and COLLATE.
Example:
CREATE DATABASE database_name CHARACTER SET utf8 COLLATE utf8_japanese_ci;
ALTER DATABASE (database_name) CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER DATABASE affects only creation of new tables. You cannot use ALTER DATABASE to rename a database.
Any warning generated when IF EXISTS is used can be displayed with SHOW WARNINGS.