1. MySQL Database Backup 1. create a test database createdatabasexscjCHARACTERSETutf8COLLATEutf8_general_ci; 2. create a table
1. MySQL database Backup 1. create Test database xscj character set utf8 COLLATE utf8_general_ci; 2. create Table create
I. MySQL Database Backup
1. Create a Test Database
Create database xscj character set utf8 COLLATE utf8_general_ci;
2. Create a table
Create table student (
Sno int (10) not null comment 'student ID ',
Sname varchar (16) not null comment 'name ',
Ssex char (2) not null comment 'gender ',
Sage tinyint (2) not null default '0' COMMENT 'student age ',
Sdept varchar (16) default null comment 'student's Department ',
Primary key (Sno)
) ENGINE = InnoDB AUTO_INCREMENT = 1 default charset = utf8;
3. insert data
Set names gbk;
Insert into student values (0001, 'louya ', 'mal', 24, 'computer Network ');
Insert into student values (0002, 'qzj', 'male', 26, 'computerapplication ');
Insert into student values (0003, 'xiaozhang', 'mal', 28, 'logistics management ');
Insert into student values (0004, 'pulsating ', 'male', 29, 'computerapplication ');
Insert into student values (0005, 'ydds ', 'male', 26, 'computer Science and Technology ');
Mysql> use xscj
Database changed
Mysql> show tables;
+ ---------------- +
| Tables_in_xscj |
+ ---------------- +
| Student |
+ ---------------- +
1 row in set (0.00 sec)
Mysql> select * from student;
+ ----- + ----------- + ------ + ------------------ +
| Sno | Sname | Ssex | Sage | Sdept |
+ ----- + ----------- + ------ + ------------------ +
| 1 | Lu ya | male | 24 | computer network |
| 2 | kqzj | male | 26 | computerapplicat |
| 3 | xiaozhang | male | 28 | logistics management |
| 4 | pulsation | male | 29 | computerapplicat |
| 5 | ydds | male | 26 | Computer Science and Technology |
+ ----- + ----------- + ------ + ------------------ +
5 rows in set (0.00 sec)
,