feat: add mysql shell bits
This commit is contained in:
parent
a7d201f054
commit
8448d98ffe
1 changed files with 12 additions and 1 deletions
|
|
@ -11,7 +11,6 @@ This is tested on MariaDB 11.
|
||||||
```
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|
||||||
[mysqld]
|
[mysqld]
|
||||||
server-id = 1
|
server-id = 1
|
||||||
log-bin = /var/log/mysql/mysql-bin.log
|
log-bin = /var/log/mysql/mysql-bin.log
|
||||||
|
|
@ -26,6 +25,10 @@ Restart mysql: `systemctl restart mysql`
|
||||||
|
|
||||||
### Create replication user
|
### Create replication user
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mysql -u root -p
|
||||||
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
DROP USER IF EXISTS 'replicator'@'replica.example.com';
|
DROP USER IF EXISTS 'replicator'@'replica.example.com';
|
||||||
CREATE USER 'replicator'@'replica.example.com' IDENTIFIED BY 'supersecure';
|
CREATE USER 'replicator'@'replica.example.com' IDENTIFIED BY 'supersecure';
|
||||||
|
|
@ -83,6 +86,10 @@ mysql -u root -p < /tmp/databeast.sql
|
||||||
|
|
||||||
### Activate replication
|
### Activate replication
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mysql -u root -p
|
||||||
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
STOP REPLICA;
|
STOP REPLICA;
|
||||||
RESET REPLICA;
|
RESET REPLICA;
|
||||||
|
|
@ -96,6 +103,10 @@ START REPLICA;
|
||||||
|
|
||||||
## Monitor replication
|
## Monitor replication
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mysql -u root -p
|
||||||
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
SHOW REPLICA STATUS\G
|
SHOW REPLICA STATUS\G
|
||||||
*************************** 1. row ***************************
|
*************************** 1. row ***************************
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue