MySQL Master-slave replication

Source: Internet
Author: User

0. Common commands

12345678 删除表中所有数据truncate 表名;reset master; 清除所有的bin-log日志show master status;查看授权用户show grants for[email protected];重启Mysqlpkill mysqld
1.Mysql Licensing
12 grant all on *.* to ‘user1‘@192.168.10.2 identified by ‘pass‘;selectuser,host,password from mysql.user;
2.Mysql master-slave replication
123 change master to master_host=‘192.168.10.1‘, master_user=‘slave‘, master_password=‘test.com‘, master_log_file=‘mysql-bin.000007‘, master_log_pos=334;start slave;show slave status\G
3.Mysql Manual Backup
1 /usr/local/mysql/bin/mysqldump-uroot -p123 test-l -F ‘/tmp/test.sql‘
4.Mysql bin-log Log Manual recovery
1 /usr/local/mysql/bin/mysqlbinlog--no-defaults mysql-bin.000002 | /usr/local/mysql/bin/mysql-uroot -p123 test
5.Mysql Database Recovery
1 /usr/local/mysql/bin/mysql-uroot -p123 test</tmp/test.sql

MySQL Master-slave replication

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.