weixin_44061757 2019-04-08 17:48 采纳率: 0%
浏览 1052

mysql 插入数据中文乱码

我用navicat写的插入数据这样的话会失败,乱码。数据库和表的编码都是utf8的。后来我换了一种方法就成功了,就是改成了

insert into Student values('01' , '赵雷' , '1990-01-01' , '男'),

('02' , '钱电' , '1990-12-21' , '男'),

('03' , '孙风' , '1990-05-20' , '男'),

('04' , '李云' , '1990-08-06' , '男'),
('05' , '周梅' , '1991-12-01' , '女'),

('06' , '吴兰' , '1992-03-01' , '女'),

('07' , '郑竹' , '1989-07-01' , '女'),

('08' , '王菊' , '1990-01-20' , '女');

以下是错误的以及提示,不懂为什么,版本的问题么

mysql>
insert into Student values(04 , '李云' , '1990-08-06' , '男');

insert into Student values(05 , '周梅' , '1991-12-01' , '女');

insert into Student values(06 , '吴兰' , '1992-03-01' , '女');

insert into Student values('07' , '郑竹' , '1989-07-01' , '女');

insert into Student values('08' , '王菊' , '1990-01-20' , '女');

Query OK, 1 row affected

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''濂?)' at line 1
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''濂?)' at line 1
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''濂?)' at line 1
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''濂?)' at line 1
mysql> delete table student;
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table student' at line 1
mysql> drop table student;
Query OK, 0 rows affected

  • 写回答

2条回答

  • Jia_Li_z 2019-04-08 18:03
    关注

    你可以修改为字符集utf8mb4,排序规则:utf8mb4_general_ci

    评论

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作