Để hiển thị đúng dấu nháy đơn phải, cần ALTER TABLE với COLLATE='utf8_unicode_ci'.
Tạo bảng:
mysql> create table DemoTable2000 ( Name varchar(20) ); Query OK, 0 rows affected (0.81 sec)
Thay đổi collation:
mysql> ALTER TABLE DemoTable2000 COLLATE='utf8_unicode_ci'; Query OK, 0 rows affected (0.90 sec) Records: 0 Duplicates: 0 Warnings: 0
Chèn dữ liệu có dấu nháy:
mysql> insert into DemoTable2000 values('Chris's Brown'); Query OK, 1 row affected (0.09 sec)
mysql> insert into DemoTable2000 values('David's Miller'); Query OK, 1 row affected (0.67 sec)
mysql> insert into DemoTable2000 values('Robert's Downey'); Query OK, 1 row affected (0.15 sec)
Hiển thị dữ liệu:
mysql> select * from DemoTable2000;
+-------------------+ | Name | +-------------------+ | Chris's Brown | | David's Miller | | Robert's Downey | +-------------------+ 3 rows in set (0.00 sec)