标签:rest limit tran city concat mysql 基于 工具介绍 style
逻辑备份:SQL语句的备份
物理备份:数据页备份
select xxxx from t1 into outfile ‘/tmp/redis.txt‘ mysql -uroot -p123 -e "select concat(‘hmset city_‘,id,‘ id ‘, id,‘ name ‘,name,‘ countrycode ‘,countrycode,‘ district ‘,district,‘ population ‘,population) from world.city limit 10 "|redis-cli mysqldump -u -p -S -h -P -A 全库备份 mysqldump -uroot -p123 -A >/backup/full.sql -B 备份一个或多个指定库 mysqldump -uroot -p123 -B world bbs >/backup/wb.sql 备份单库中的表 mysqldump -uroot -p123 world city country >/backup/ccc.sql --master-data=2 备份时记录二进制日志的状态 --single-transaction 开启innodb热备功能 -R --triggers mysqldump -uroot -p123 -A --master-data=2 --single-transaction -R --triggers >/backup/full.sql
基于二进制日志完成的.
Master slave
3307---->3308
3.1 3307中创建复制用户
主库开启二进制日志
vim /data/3307/my.cnf log_bin=/data/3307/mysql-bin [root@standby 3307]# systemctl restart mysqld3307 [root@standby backup]# mysql -S /data/3307/mysql.sock grant replication slave on *.* to repl@‘10.0.0.%‘ identified by ‘123‘; mysql> show master status -> ; +------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +------------------+----------+--------------+------------------+-------------------+ | mysql-bin.000001 | 154 | | | | +------------------+----------+--------------+------------------+-------------------+ 1 row in set (0.00 sec)
3.2 3308节点开启主从复制功能
[root@standby 3307]# mysql -S /data/3308/mysql.sock mysql> CHANGE MASTER TO MASTER_HOST=‘10.0.0.200‘, MASTER_USER=‘repl‘, MASTER_PASSWORD=‘123‘, MASTER_PORT=3307, MASTER_LOG_FILE=‘mysql-bin.000001‘, MASTER_LOG_POS=154; mysql> start slave; mysql> show slave status\G Slave_IO_Running: Yes Slave_SQL_Running: Yes
标签:rest limit tran city concat mysql 基于 工具介绍 style
原文地址:https://www.cnblogs.com/zhaijihai/p/10279016.html