欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

MySQL数据库备份及增量备份

程序员文章站 2024-01-02 10:17:28
...

一.MySQL数据库的备份 1.创建测试数据库 create database xscj CHARACTER SET utf8 COLLATE utf8_general_ci; 2.创建表 create

一.MySQL数据库的备份

1.创建测试数据库

create database xscj CHARACTER SET utf8 COLLATE utf8_general_ci;

2.创建表

create table student(

Sno int(10) NOT NULL COMMENT '学号',

Sname varchar(16) NOT NULL COMMENT '姓名',

Ssex char(2) NOT NULL COMMENT '性别',

Sage tinyint(2) NOT NULL default '0' COMMENT '学生年龄',

Sdept varchar(16) default NULL COMMENT '学生所在系别',

PRIMARY KEY (Sno)

) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

3.插入数据

set names gbk;

INSERT INTO student values(0001,'陆亚','男',24,'计算机网络');

INSERT INTO student values(0002,'kqzj','男',26,'computerapplication');

INSERT INTO student values(0003,'xiaozhang','男',28,'物流管理');

INSERT INTO student values(0004,'脉动','男',29,'computerapplication');

INSERT INTO student values(0005,'ydds','男',26,'计算机科学与技术');

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 | 陆亚 | 男 | 24 | 计算机网络 |

| 2 | kqzj | 男 | 26 | computerapplicat |

| 3 | xiaozhang | 男 | 28 | 物流管理 |

| 4 | 脉动 | 男 | 29 | computerapplicat |

| 5 | ydds | 男 | 26 | 计算机科学与技术 |

+-----+-----------+------+------+------------------+

5 rows in set (0.00 sec)

MySQL数据库备份及增量备份

上一篇:

下一篇: