CHARACTER SET utf8 for column definition : CHARSET « I18N « SQL / MySQL






CHARACTER SET utf8 for column definition

    
mysql>
mysql> CREATE TABLE TABCOLLATE
    ->       (C1   CHAR(10)
    ->             CHARACTER SET utf8
    ->             COLLATE utf8_romanian_ci NOT NULL,
    ->        C2   VARCHAR(10)
    ->             CHARACTER SET utf8
    ->             COLLATE utf8_spanish_ci)
    -> ;
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT   COLUMN_NAME, CHARACTER_SET_NAME, COLLATION_NAME
    -> FROM     INFORMATION_SCHEMA.COLUMNS
    -> WHERE    TABLE_NAME = 'TABCOLLATE';
+-------------+--------------------+------------------+
| COLUMN_NAME | CHARACTER_SET_NAME | COLLATION_NAME   |
+-------------+--------------------+------------------+
| C1          | utf8               | utf8_romanian_ci |
| C2          | utf8               | utf8_spanish_ci  |
+-------------+--------------------+------------------+
2 rows in set (0.00 sec)

mysql>
mysql> drop table TABCOLLATE;
Query OK, 0 rows affected (0.00 sec)

mysql>

   
    
    
    
  








Related examples in the same category

1.Set DEFAULT CHARSET=latin1
2.The CHARSET() function identifies the character set used for a specified string
3.Get CHARSET
4.Get the charset and collation information
5.Optionally, you can specify a default character set and sort order:
6.Change the Character Set of All Text Columns
7.MySQL Character Set Variables
8.Changing the Character Set
9.Specifying the Character Set of a Character String (Cast Operator)
10.CREATE DATABASE statement specifies the character set and collation:
11.To change the character set to latin1 for the BookSales database, use the following ALTER DATABASE statement
12.CONVERT( USING )
13.Check the character set
14.Check the character set name and description
15.Character setting for char type column
16.CHARACTER SET 'latin1', CHARACTER SET 'hp8'
17.Check the character set settings
18.Check the default character set name
19.Table with default chartset= latin1;
20.Set default character during table definition