SQL Alter Database.

Using SQL ALTER statement on sql databases.

ALTER statement is used to change a database characteristics.

Syntax:
MySQL:
ALTER {DATABASE | SCHEMA} [db_name]
[[DEFAULT] CHARACTER SET charset_name
| [DEFAULT] COLLATE collation_name]

character_name is a set of symbols and encodings. DBMS will set a default if not set.

collation_name is a set of rules for comparing characters in a character set. DBMS will set a default if not set.

Alter database example:
ALTER DATABASE customerdb
 CHARACTER SET utf8;
To show all existing CHARACTER SET available use:
SHOW CHARACTER SET;
To show all existing COLLATIONS available use:
SHOW COLLATION;
To see the default character set and collation for a given database, use these statements::
USE db_name;
SELECT @@character_set_database, @@collation_database;
© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.