Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use mysqldump/xtrabackup backup

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

< hellodb.sql [root@localhost ~]# msyql-bash: msyql: command not found[root@localhost ~]# mysqlWelcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 29Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]>

Show databases;+-+ | Database | +-+ | information_schema | | hellodb | | mysql | | performance_schema | | test | +-+ 5 rows in set (0.00 sec) MariaDB [(none)] >

First incremental backup

[root@localhost] # innobackupex-- incremental--user=root-- host=localhost / data/backup/-- incremental-basedir=/data/backup/2017-01-1911 14-50-46 /

[root@localhost ~] # ll / data/backup/total 8drwx-5 root root 4096 Jan 19 14:50 2017-01-1911 14-50-46drwx-6 root root 4096 Jan 19 14:56 2017-01-19 December 14-56-12 [root@localhost] # cat / data/backup/2017-01-19 December 14-56-12/xtrabackup_checkpoints backup_type = incrementalfrom_lsn = 1680362to_lsn = 1708884last_lsn = 1708884compact = 0recover_binlog_info = 0 [root@localhost ~] #

Add table to hellodb database

[root@localhost] # mysqlWelcome to the MariaDB monitor. Commands end with; or\ g.Your MariaDB connection id is 32Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or'\ h' for help. Type'c'to clear the current input statement.MariaDB [(none)] > ls->; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ls' at line 1MariaDB [(none)] > use hellodb;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with-ADatabase changedMariaDB [hellodb] > create table (id int,name char); Query OK, 0 rows affected (0.01 sec) MariaDB [hellodb] >

Perform a second incremental backup

[root@localhost] # innobackupex-- incremental--user=root-- host=localhost / data/backup/-- incremental-basedir=/data/backup/2017-01-1911 14-56-12 /

[root@localhost ~] # ll / data/backup/total 12drwx-5 root root 4096 Jan 19 14:50 2017-01-1913 14-50-46drwx-6 root root 4096 Jan 19 14:56 2017-01-19 December 14-56-12drwx-6 root root 4096 Jan 19 15:02 2017-01-19 December 15-02-14 [root@localhost] # cat / data/backup/2017-01-19 December 15-02-14 Checkpoints backup_type = incrementalfrom_lsn = 1708884to_lsn = 1711375last_lsn = 1711375compact = 0recover_binlog_info = 0 [root@localhost ~] #

* differential backup

[root@localhost] # innobackupex-- incremental--user=root-- host=localhost / data/backup/-- incremental-basedir=/data/backup/2017-01-1911 14-50-46 /

[root@localhost] # ll / data/backup/total 16drwx-5 root root 4096 Jan 19 14:50 2017-01-1911 14-50-46drwx-6 root root 4096 Jan 19 14:56 2017-01-19 December 14-56-12drwx-6 root root 4096 Jan 19 15:02 2017-01-1911 15-02-14drwx-6 root root 4096 Jan 19 15:06 2017-01-19 December 15-06-29 [ Root@localhost ~] # cat / data/backup/2017-01-1900 15-06-29/xtrabackup_checkpoints backup_type = incrementalfrom_lsn = 1680362to_lsn = 1711375last_lsn = 1711375compact = 0recover_binlog_info = 0 [root@localhost ~] # incremental restore

Restore data to a new server

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report