Difference between revisions of "MySQL notater"
From Teknologisk videncenter
m (→Slave) |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
= simple Master slave replication setup = | = simple Master slave replication setup = | ||
+ | *See [http://www.linuxforum.dk/2004/program/slides/carsten_pedersen/LinuxForum-MySQL.pdf] | ||
== Master == | == Master == | ||
my.cnf: | my.cnf: | ||
Line 35: | Line 36: | ||
mysql> SLAVE START; | mysql> SLAVE START; | ||
</source> | </source> | ||
+ | = Links = | ||
+ | *[http://hashmysql.org/index.php?title=Main_Page MySQL WIKI] | ||
[[Category:database]] | [[Category:database]] |
Latest revision as of 09:57, 17 December 2009
simple Master slave replication setup
- See [1]
Master
my.cnf:
[mysqld]
log-bin
server-id=1
#Next is only required if the
#master is a slave as well
log-slave-updates
Setup up in shell
shell> mysqldump –master-data \
> master.sql
mysql> GRANT REPLICATION SLAVE ON *.*
-> to rpl_user@host IDENTIFIED BY
-> ‘rpl_pass’;
Slave
my.cnf:
[mysqld]
server-id=2
Setup in shell
shell> mysql < master.sql
mysql> CHANGE MASTER TO
-> MASTER_HOST=‘master host’,
-> MASTER_USER=‘rpl_user’,
->
MASTER_PASSWORD=‘rpl_pass’,
-> MASTER_PORT=MySQL_port;
mysql> SLAVE START;