MySQL default link number 15 port 3306 [email protected]
Create Database MyBase character Set utf-8;
Use MyBase;
drop table students;
CREATE TABLE Students (
Name Char (8),
Sex char (4),
Age tinyint unsigned is not NULL,
Tel char (+) NULL default "-"
) default Charset=utf8;
Set names GBK;
/*
Method one: Before inserting Chinese, the command set names GBK tells the client that the command you are knocking on here is GBK the encoded client will turn the command you are going to
UTF-8 the code inside your database is still UTF-8.
*/
INSERT into students (name, sex, age, tel) value ("Zhangpenyang", "Man", 25, "15388128692");
SELECT * from students;
INSERT into students (name, sex, age) value ("Zhang Peng", "male", 23);
Update students set sex= "male" where name= "Zhangpenyang";
Delete from students where name= "yangming" and tel= "15388128692";
Utf-8 's MySQL table notes