-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmysql_cdc.sql
31 lines (25 loc) · 901 Bytes
/
mysql_cdc.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
select version();
CREATE SCHEMA IF NOT EXISTS RedisConnect DEFAULT CHARACTER SET utf8;
SHOW DATABASES;
SELECT variable_value as "BINARY LOGGING STATUS (log-bin) ::" FROM performance_schema.global_variables WHERE variable_name='log_bin';
-- create a demo user for bin_log based replication
CREATE USER 'redisconnectuser' IDENTIFIED BY 'redisconnectpassword';
-- Grant the required permissions to the user
GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'redisconnectuser';
-- check the permissions
SELECT * from mysql.`user` where user='redisconnectuser';
use RedisConnect;
CREATE TABLE IF NOT EXISTS emp (
empno int NOT NULL,
fname varchar(50),
lname varchar(50),
job varchar(50),
mgr int,
hiredate datetime,
sal decimal(13, 2),
comm decimal(13, 2),
dept int,
PRIMARY KEY (empno)
)
ENGINE = InnoDB;
desc emp;