码迷,mamicode.com
首页 > 数据库 > 详细

utf-8的mysql表笔记

时间:2015-07-13 18:02:15      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:

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";

utf-8的mysql表笔记

标签:

原文地址:http://www.cnblogs.com/pyfreshman/p/4643090.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!