一、确保mysql开启了binlog日志功能
在/etc/my.cnf文件里的[mysqld]区块添加:
#这个是存储的位置为mysql配置文件的位置
log-bin=mysql-bin
然后重启mysql服务生效
二、创建数据库
先创建一个ops数据库
create database ops;
use ops;
创建一个customers表并写上表结构
create table customers(
id int not null auto_increment,
name char(20) not null,
age int not null,
primary key(id)
)engine=InnoDB;
查看创建好的表
desc customers;
表中插入数据:
insert into customers values(1,"wangbo","24");
insert into customers values(2,"guohui","22");
insert into customers values(3,&