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