create database my_database charset=utf8;-- 创建数据库utf8 create table my_student(ID varchar(10),name varchar(10),gender varchar(10),age int)charset=utf8;-- 创建表utf8 insert into my_student values('01','Jim','man',18);-- 插入数据 -- 插入中文数据没出现乱码, insert into my_student values('02','张三','男',20); select * from my_student;-- 结果也是正常没出现乱码 -- 快捷设置字符集(视频里要设置这个,我没设置下面代码、为什么不出现乱码?) set name gbk;
Chinese question I am using the cmd client GBK, why do I not encounter any garbled characters? 5.7.15-log MySQL-PHP Chinese website Q&A-Chinese question I am using the cmd client GBK, why do I not encounter any garbled characters? 5.7.15-log MySQL-PHP Chinese website Q&A
Have a look and learn.
This question is very strange. Do you seem to like garbled characters? , Do you like garbled codes? ? Wouldn’t it be nice to have no garbled characters? ?