Mega Code Archive

 
Categories / MySQL Tutorial / Table
 

Using alter command to change characgter set

mysql>  CREATE TABLE myTable     -> (     ->     col1 CHAR(10)     -> ) DEFAULT CHARACTER SET latin1 COLLATE latin1_danish_ci; Query OK, 0 rows affected (0.05 sec) mysql> mysql> ALTER TABLE myTable MODIFY col1 CHAR(50) CHARACTER SET greek; Query OK, 0 rows affected (0.03 sec) Records: 0  Duplicates: 0  Warnings: 0 mysql> ALTER TABLE myTable MODIFY col1 CHAR(50) CHARACTER SET utf8; Query OK, 0 rows affected (0.03 sec) Records: 0  Duplicates: 0  Warnings: 0 mysql> mysql> drop table myTable; Query OK, 0 rows affected (0.00 sec) mysql>