
本文共 3838 字,大约阅读时间需要 12 分钟。
MySQL���������������������������������
MySQL���������������������������������������������������DBA���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MySQL���������������������������������������������
������������������������
1. ������MySQL������
������������������������������MySQL������������������������������������������������������MySQL���������
mysql -uroot -p
���������������������������������MySQL������������������������������������������������
2. ������������Binlog������
������������������������������Binlog���������������
show master logs;
**���������������** ``` +---------------+-----------+ | Log_name | File_size | +---------------+-----------+ | binlog.000001 | 164 | | binlog.000002 | 120 | +---------------+-----------+ 2 rows in set (0.00 sec) ```
3. ���������������
������������������������������������������������������������������������������������
use test;create table test001 ( id int, name varchar(10));
**���������������������** ```sql show tables; ```
4. ������������Binlog������
������������������Binlog������������������������������������clear���������������
reset master;
������������������������
1. ������innobackupex������������
���root������������������innobackupex������������������������������������������
innobackupex --defaults-file=/path/to/my.cnf --user=root --password='root123' --no-timestamp /apps/backup/xtrabackup
**���������������������** - `--defaults-file`���������MySQL��������������������� - `--user`���`--password`��������������������������������� - `--no-timestamp`��������������������������������� - `--socket`���������MySQL������������������ - ���������������������������������������������
2. ������������������
���������������������������������������������������������������������������
tail -f /var/log/mysql/innobackupex.log
������������������������������������
������������������������������������������������������������
1. ������MySQL������
������������������������������������������������������������MySQL���������
./stop_mysqld.sh
2. ������������������
���������������������������������������������������
cp -fr /apps/backup/xtrabackup/* /u01/my3306/data/chown -R mysql:mysql /u01/my3306/data/
������������������������
1. ������Binlog������
������innobackupex������Binlog������������������������������������������������
innobackupex --defaults-file=/apps/backup/xtrabackup/backup-my.cnf --apply-log --user=root --password='root123' /apps/backup/xtrabackup
**���������������** - `--apply-log`���������Binlog���������������������������������������������
2. ������MySQL������
������������MySQL���������
./start_mysqld.sh
������������������������������
���������������������������������������������������������������
use test;select * from test001;
**���������������** ```sql +------+-------+ | id | name | +------+-------+ | 1 | AAAA | | 2 | BBBB | | 3 | CCCCC | +------+-------+ 3 rows in set (0.00 sec) ```
������Binlog������������
������������Binlog������������������������������������������
show variables like '%log%';
**���������������** ```sql +----------------------------------------+------------------------+ | Variable_name | Value | +----------------------------------------+------------------------+ | binlog_format | ROW | | binlog_row_image | FULL | +----------------------------------------+------------------------+ ```
������������
������������������������������������������������������������������������������������������������������������
���������������������MySQL������������������������������������������
������������������������availability������������������������������������������������������
������������������������������������������MySQL���������������������������������������������������������������������������
发表评论
最新留言
关于作者
