1、查看当前配置 (root@localhost)[(none)] show global variables like 'log_bin'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | log_bin | ON | +---------------+-------+ 1 row in set (0.02 sec)
(root@localhost)[(none)] show global variables like 'expire_logs_days'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | expire_logs_days | 0 | +------------------+-------+ 1 row in set (0.00 sec)
(root@localhost)[(none)] show global variables like 'max_binlog_size'; +-----------------+------------+ | Variable_name | Value | +-----------------+------------+ | max_binlog_size | 1073741824 | +-----------------+------------+ 1 row in set (0.00 sec)
[root@dbrac16 ~]# ll /usr/local/mysql/data/mysql-bin* -rw-r----- 1 mysql mysql 614 May 11 10:06 /usr/local/mysql/data/mysql-bin.000001 -rw-r----- 1 mysql mysql 1595 May 17 09:45 /usr/local/mysql/data/mysql-bin.000002 -rw-r----- 1 mysql mysql 445747850 May 19 14:28 /usr/local/mysql/data/mysql-bin.000003 -rw-r----- 1 mysql mysql 117 May 17 11:16 /usr/local/mysql/data/mysql-bin.index
2、查看slave状态 [root@dbrac17 ~]# mysql -uroot -p123456 -e "show slave status/G" | grep Master_Log_File mysql: [Warning] Using a password on the command line interface can be insecure. Master_Log_File: mysql-bin.000003 Relay_Master_Log_File: mysql-bin.000003