Utf-8 's MySQL table notes

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.