링크 조회 : 493
master mysql > GRANT REPLICATION SLAVE ON *.*
-> TO 'user_name'@'user_host' IDENTIFIED BY 'user_password';
master mysql > GRANT FILE ON *.*
-> TO 'user_name'@'user_host' IDENTIFIED BY 'user_password';
master mysql > FLUSH TABLES WITH READ LOCK; master shell > tar -cvf /tmp/mysql-snapshot.tar . slave shell > tar -xvf /tmp/mysql-snapshot.tar master mysql > UNLOCK TABLES;
master Shell > mysqldump -u root -p ‘password’ -B db_name > dump_file.sql
master shell> vi /etc/my.cnf
[mysqld] log-bin server-id = 1
slave shell> vi /etc/my.cnf
[mysqld] server-id = 2 master-host = xxx.xxx.xxx.xxx(user_host) master-port = 3306 master-user = user_name master-password = user_password
slave shell > mysql -u root -p < dump_file.sql
slave mysql > CHANGE MASTER TO
-> MASTER_HOST='master_host_name',
-> MASTER_USER='replication_user_name',
-> MASTER_PASSWORD='replication_password',
-> MASTER_LOG_FILE='recorded_log_file_name',
-> MASTER_LOG_POS=recorded_log_position;
MASTER_HOST 60 MASTER_USER 16 MASTER_PASSWORD 32 MASTER_LOG_FILE 255
Slave I/O thread: connected to master 'user_name@user_host:3306', replication started in log 'FIRST' at position 4
mysql2 mysql > GRANT REPLICATION SLAVE ON *.*
-> TO 'users_name'@'users_host' IDENTIFIED BY 'users_password';
mysql1 shell > /etc/init.d/mysqld stop
[mysqld] server-id = 1 <= 그대로 두고, 아래 내용을 추가한다. master-host = users_host master-port = 3306 master-user = users_name master-password = users_password
Slave I/O thread: connected to master 'ccotti@222.112.137.172:3306', replication started in log 'FIRST' at position 4
mysql1 shell > /etc/init.d/mysqld start
mysql2 mysql > slave stop; mysql2 mysql > slave reset; mysql2 mysql > slave start;
| 제목 |
|---|
| [기본형] HTML (with 부트스트랩5.3 , jquery 3.7, vue.js) |
| 유용한 리눅스(LINUX) 명령어 |
| [공지] 기술 게시판 |
일 |
월 |
화 |
수 |
목 |
금 |
토 |
|---|---|---|---|---|---|---|
|
4.26
|
4.27
|
4.28
|
4.29
|
4.30
|
5.1
|
5.2
|
|
5.3
|
5.4
|
5.5
|
5.6
|
5.7
|
5.8
|
5.9
|
|
5.10
|
5.13
|
5.14
|
5.15
|
5.16
|
||
|
5.17
|
5.18
|
5.19
|
5.20
|
5.21
|
5.22
|
5.23
|
|
5.24
|
5.25
|
5.26
|
5.27
|
5.28
|
5.29
|
5.30
|
|
5.31
|
6.1
|
6.2
|
6.3
|
6.4
|
6.5
|
6.6
|