MySQL Master-Slave Construction (2)-Hot spare-no lock table

Source: Internet
Author: User

Master on authorization from the library:

```
Grant Replication Slave on * * to [e-mail protected] identified by ' password ';
```

Database-based Hotcopy backup script processing:

```

[[email protected] 20150806104509]# ls
BACKUP-MY.CNF SSS ibdata1 ib_logfile0 ib_logfile1 ABC xtrabackup_binlog_info xtrabackup_binlog_pos_innodb XTRABACKUP_ Checkpoints Xtrabackup_galera_info Xtrabackup_info Xtrabackup_logfile

[email protected] 20150806104509]# cat Xtrabackup_binlog_pos_innodb
mysql-bin.000043774365349

```

```
Service MySQL Stop
rm-rf/var/lib/mysql/ib*
Rm-rf/var/lib/mysql/abc
Rm-rf/var/lib/mysql/sss

Cp-r/data/20150806104509/abc/data/20150806104509/sss ib*/data/mysql (SCP of backup data to slave)

Chown-r Mysql:mysql/data/mysql (authorized MySQL user)

Service MySQL Start
```

Restart slave Mysql to do the following:

```
Mysql-uroot-p

Change Master to master_host= ' IP ', master_user= ' slave1 ', master_password= ' password ', master_port=3306, Master_log_ File= ' mysql-bin.000043 ', master_log_pos=774365349;

Slave start;

Show Slave Status\g
```

There are two yes, the configuration is successful,
Slave_io_running:yes
Slave_sql_running:yes

MySQL Master-Slave Construction (2)-Hot spare-no lock table

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.