IanMK2 Blog

[MySQL] Slave설정

2012. 5. 7. 10:39 : Development/etc

my.cnf 에서 server-id 및 log-bin 주석해제하고


마스터에서 

show master status;

에서 값 기록


슬레이브에서

init slave;

change master to master_host='주소드아아아', master_user='유저드아아', master_password='암호드아아', master_log_file='마스터의 로그파일', master_log_pos=로그위치;

start slave;



Posted by IanMK2

SELECT table_schema "Database Name", SUM(data_length + index_length) / 1024 / 1024 "Size(MB)" FROM information_schema.TABLES GROUP BY table_schema;

Posted by IanMK2

처음에 mysql 설치하고나서 외부에서 접속하기 위한 커맨드

mysql> grant all privileges on *.* to root@"%" identified by '암호돠아아아아아' with grant option;


mysql> select host, user from user;

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

| host      | user |

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

| %         | root |

| localhost | root |

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


Posted by IanMK2