0
我有一個表中已經有數據的表。我想更改其中一列的字符編碼。目前該列似乎有兩種編碼。即使在改變它之後,我也看到了相同的結果。如何更改mysql表中列的字符編碼
當前編碼
mysql> SELECT character_set_name FROM information_schema.`COLUMNS`
-> WHERE table_name = "mytable"
-> AND column_name = "my_col";
+--------------------+
| character_set_name |
+--------------------+
| latin1 |
| utf8 |
+--------------------+
2 rows in set (0.02 sec)
更改編碼(0行受影響)
mysql> ALTER TABLE mytable MODIFY my_col LONGTEXT CHARACTER SET utf8;
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0