In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to achieve physical backup and incremental backup in mysql. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Physical backup:
SHOW VARIABLES LIKE'datadir'
Use hellodb
SHOW TABLE STATUS
Mysql
FLUSH LOGS WITH READ LOCK
\ Q
Lvcreate-L 50m-n mysnap-s / dev/myvg/mydata
Mysql
UNLOCK TABLES
\ Q
Mount / dev/myvg/mysnap / mnt
Cd / mnt
Cd data/
Ls
Tar-jcf / root/mysql.tar.bz2 hellodb ibdata1 ib_logfile* mysql-bin*
Ls
Cd
Umount / mnt
Lvremove-force / dev/myvg/mysnap
Service mysqld start
Ls / mydata/data
Rm-rf / mydata/data/*
Cd / usr/local/mysql
Chown-R mysql:mysql data/
Scripts/-datadir=/mydata/data-user=mysql
Killall mysqld
Service mysqld start
Service mysqld stop
Cd / mydata
Cd data
Ls
Tar xf / root/mysql.tar.bz2-C. /
Ls
Service mysqld start
Mysql
SHOW DATABASES
Incremental backup:
SHOW MASTER STATUS
Lvcreate-L 50m-n mysnap-s / dev/myvg/mydata
Mysql
UNLOCK TABLES
Tar-jcf / root/mysql.tar.bz2 hellodb ibdata1 ib_logfile* mysql-bin*
Mysql
Use hellodb
INSERT INTO T2 values ('huhu')
SHOW MASTER STATUS
Mysqlbinlog-- start-position 201 mysql-bin.000004 > / root/mysql2.incr.sql
Cd
Serviece mysqld stop
Rm-rf / mydata/data/*
Cd / usr/local/mysql
Chown-R mysql:mysql data/
Scripts/-datadir=/mydata/data-user=mysql
Service mysqld start
Serviece mysqld stop
Cd / mydata/data/
Tar xf / root/mysql.tar.bz2-C. /
Service mysqld start
Mysql
Use hellodb
SELECT * FROM T2
# mysql
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.