MySQL Alter Database

  • ALTER DATABASE enables us to change the overall characteristics of a database.
  • To use ALTER DATABASE, we need the ALTER privilege on the database.
  • ALTER SCHEMA is a synonym for ALTER DATABASE.

MySQL ALTER DATABASE Syntax:

ALTER {DATABASE | SCHEMA} [db_name]
alter_specification …
ALTER {DATABASE | SCHEMA} db_name
UPGRADE DATA DIRECTORY NAME
alter_specification:
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_name