当前位置:网站首页>mysql_ Backup restore_ Specify table_ Backup table_ Restore table_ innobackup
mysql_ Backup restore_ Specify table_ Backup table_ Restore table_ innobackup
2022-07-25 03:00:00 【angela_ dba_ chao】
1 Back up the specified table :
1.1 Introduce
Backup tables :zkr.orderinfo
Backup path :/data/backupDB/baktb/20220428.xbstream
Backup log files :/data/backupDB/baktb/bakuptb20220428.log
notes : hold mysql The library is backed up at the same time
1.2 Script : Compress , Parallel backup scripts
/usr/bin/innobackupex --defaults-file=/etc/my.cnf --user=dbbackup --password=dbbackuppassword --compress --compress-threads=4 --stream=xbstream --parallel=5 -S /mysql/mysql.sock --host=127.0.0.1 --databases="zkr.orderinfo mysql" /data/backupDB/baktb/> /data/backupDB/baktb/20220428.xbstream 2>/data/backupDB/baktb/bakuptb20220428.log
Backup complete
2 Steps to restore the backup table :
2.1 Create folder :
mkdir -pv /data/backupDB/baktb/outputdir
2.2 Open compressed file :
xbstream -x < /data/backupDB/baktb/20220428.xbstream -C /data/backupDB/baktb/outputdir/
2.3 Entry directory :
cd outputdir
2.4 decompression :
innobackupex --decompress --parallel=8 --compress-threads=7 ./
2.5 Delete compressed file , If you don't delete , Errors will be reported later
find ./ -name "*.qp" |xargs rm -rf
2.6 Roll back uncommitted transactions , Execute this sentence first, and then recover the data :
innobackupex --apply-log /data/backupDB/baktb/outputdir/
2.7 close mysql example :
service mysql stop
2.8 Back up the tables that need to be restored :
mv /mysql/zkr/orderinfo.frm /mysql/zkr/orderinfo.frm_bak_20220428
mv /mysql/zkr/orderinfo.ibd /mysql/zkr/orderinfo.ibd_bak_20220428
2.9 Copy the backup file to the database directory
cp /data/backupDB/baktb/outputdir/zkr/orderinfo.* /mysql/zkr/
2.10 Empowering documents :
chown -R mysql.mysql /mysql
2.11 Boot instance :
service mysql start
边栏推荐
- Riotboard development board series notes (VII) -- the use of framebuffer
- Mp4 package analysis
- 【C】 Advanced knowledge of file operation
- Wechat sports field reservation of the finished works of the applet graduation project (6) opening defense ppt
- Dc-1-practice
- Define macros in makefile and pass them to source code
- Publish the project online and don't want to open a port
- What should I do when the interface encounters jsonstring
- # CF #807 Div.2(A - D)
- Resolve the error: org.apache.ibatis.binding.bindingexception
猜你喜欢

How to take the mold for the picture of 1.54 inch TFT st7789 LCD screen

PHP record

Use unicloud cloud function to decode wechat motion steps in applet

Banana pie bpi-m5 toss record (3) -- compile BSP

Banana pie bpi-m5 toss record (2) -- compile u-boot

Learning record 10

What should I do when the interface encounters jsonstring

Decoding webp static pictures using libwebp

Nuscenes data set summary

Permanently mount the image steps
随机推荐
Several dpdk control frameworks
Uni app configuration
JS foundation -- data
Solve ''_ Xsrf 'argument missing from post
Hyperchain hyperblockchain Shi Xingguo was interviewed by 36 krypton: the amount of customer cooperation consulting is doubling
Simulation Implementation of string function (Part 1)
If there is a segment in the encryption field, are you "bronze" or "King"?
JS written test questions -- random numbers, array de duplication
SQL recursive follow-up
Use unicloud cloud function to decode wechat motion steps in applet
Learning record 10
Sum of "n" numbers of force deduction summary
How to switch terminators in PostgreSQL?
Resolve the error: org.apache.ibatis.binding.bindingexception
PHP record
Download the jar package of jsqlparser and PageHelper
JS written test question -- deep copy of object
Physical experiment simulation
JS written test question -- prototype, new, this comprehensive question
Wechat sports field reservation of the finished works of the applet graduation project (5) assignment