utf-8的mysql表笔记

mysql默认链接数量15 端口3306 y@ngmin9
create database mybase character set utf-8;
use mybase;
drop table students;
create table students(
name char(8),
sex char(4),
age tinyint unsigned not null,
tel char(13) null default "-"
)default charset=utf8;
set names gbk;
/*
方法一:在插入中文之前 先输命令set names gbk 告诉客户端你在这里敲的命令是GBK编码的 客户端会把你接下来敲的命令转成
UTF-8 你数据库内部的编码还是UTF-8
*/
insert into students(name, sex, age, tel) value("张彭洋明","man", 25, "15388128692");

 

select * from students;
insert into students(name, sex, age) value("张彭","男", 23);
update students set sex="男" where name="张彭洋明";
delete from students where name="yangming" and tel="15388128692";

你可能感兴趣的:(mysql)