插入记录后,MySQL没有显示正确的单引号(')

要显示正确的单引号,您需要使用COLLATE ='utf8_unicode_ci'更改表。

让我们首先创建一个表-

mysql> create table DemoTable2000
(
   Name varchar(20)
);

这是使用归类的查询-

mysql> ALTER TABLE DemoTable2000 COLLATE='utf8_unicode_ci';
Records: 0  Duplicates: 0  Warnings: 0

使用插入命令在表中插入一些记录-

mysql> insert into DemoTable2000 values('Chris’s Brown');
mysql> insert into DemoTable2000 values('David’s Miller');
mysql> insert into DemoTable2000 values('Robert’s Downey');

使用select语句显示表中的所有记录-

mysql> select * from DemoTable2000;

这将产生以下输出-

+-------------------+
| Name              |
+-------------------+
| Chris’s Brown     |
| David’s Miller    |
| Robert’s Downey   |
+-------------------+
3 rows in set (0.00 sec)