Normal size Data backup restore we can use commands and scripts. 、
1. Use the command to implement the backup
Database backup is important. If you do a regular backup, you can restore the data to the last normal state in the eve
definition file, the data file, the index file).Mysqlhotcopy can only be used for backup MyISAM.
Cases:
Back up the database test to the/backup directory:
/usr/local/mysql/bin/mysqlhotcopy-uroot-pxxx Test/backup
Mysqlhotcopy will lock the database before execution, and will automatically release the lock after com
, one or more files are generated.
Mysql-bin.000002 files store the data that is added to the database every day, where the incremental data of all databases is located.
3. check what is in a file like a mysql-bin.000002
[Root @ BlackGhost mysql] # mysqlbinlog/var/lib/mysql/mys
/myblog.sqlBack up the MyBlog database and clear the data about MyBlog in the incremental backup./mysqldump–flush-logs-u root–all-databases >/tmp/alldatabase.sqlBack up all databases, clear incremental backupsMysql-bin.index index role, because the increment of data is not necessarily in a mysql-bin000 such a file, this time, we will be based on Mysql-bin.index t
index file is mysql-bin.index.
JavaCode
[Root@ BlackghostMySQL] # Cat mysql-bin.index./MySQL-bin.000001./MySQL-bin.000002./MySQL-bin.000003./MySQL-bin.000004./MySQL-bin.000005./
tool for checking data consistency)|---> Mode consistency, using layman detection mode differencesThe MyISAM recovery process is an index rebuild of a given table, which is why a crash report on the MyISAM table is not given at system startup. Instead, the table is accessed through a given indexThe reason for the data. The *myisam-recover configuration option provides some properties that do not cause a crash for the MyISAM table. *mysql reboot for p
restoration 1. The syntax for restoring a database backed up using the mysqldump command is as follows: Mysql-u root-p [dbname] Example:Mysql-u Root-p 2. Restore the backup of the direct copy directory When restoring in this way, you must ensure that the version number of the two MySQL databases is the same. Tables
the database, cannot be abbreviated to mysql-h localhost-u root- pMysql-h localhost-u root-p TestThis is to restore the database from the "d:/" path.·····························Mysql-u root-p TestThis is restoring the database from the address of the MySQL default backup--
-$date. tar.gz "
# Delete Temp FilesRm-f $BackupDir/mysql-$date. tar.gz(3), restore the state of the database to the time of backupMysqlhotcopy Backup is the entire database directory, use can be directly copied to the mysqld specified DataDir (here is/usr/local/mysql/data/) directory, but also attention to the issue
--stop-datetime= ' 20161129 09:59:59 '/var/log/mysql/mysqlbin.000033 |mysql-uroot-pB. Skip the point in time of the failure, and continue with the subsequent binlog to complete the recovery.shell> mysqlbinlog--start-datetime= ' 20161129 10:01:00 '/var/log/mysql/mysqlbin.000033 |mysql-uroot-p2) Location-based recoveryis
Tags: mysql log management and MySQL backup restore under LinuxMySQL log management and MySQL backup restore under Linux1.SHOW GLOBAL VARIABLES like '%log% '; Show all log-related optio
new target database named News5, Input: Mysql>use target database nameAs I entered the command line: Mysql>use news;6, import file: mysql>source import filename;As I entered the command line: Mysql>source news.sql;Backing Up the databaseMySQL backup and
MySQL backup and restore details under Centos 6.4We described in the previous article in CentOS 6.4 installation and configuration of MySQL, after installation in order to ensure the security of data so we also have to learn to back up and restore,
database"(2) "mysqldump" This tool integrates these backup and restore "equivalent to a special client (not related to the MySQL client), after connecting with the MySQL server" Mysqldump is the executable file under the bin file of MySQL: mysqldump start to implement
Using mysqlworkbench graphical backup to restore mysql database bitsCN.com this article briefly introduces a simple and easy-to-use graphical interface to back up and restore the mysql database. It is helpful for friends who do not like to use command lines.
Workbench is a v
On the MySQL database backup and restore method, here is the first to refer to the Backup tool: Mysqlhotcopy, using the Mysqlhotcopy tool for quick backup, then data restore, using the MySQL
Tags: sys usr object NEC traffic Roo Delta Center offThere are currently two major tools available for physical hot provisioning: Ibbackup and Xtrabackup, Ibbackup is expensive to authorize, and Xtrabackup is more powerful and open source than Ibbackup Xtrabackup provides two command-line tools: Xtrabackup: Data dedicated to backing up the InnoDB and XTRADB engines; Innobackupex: This is a Perl script that calls the Xtrabackup command during execution to implement
Recommended UseMysqldump-uroot-p123456-a-B--master-data=2--single-transaction--events |gzip >/opt/mysql.all.gz MyISAM Mysqldump-uroot-p123456-a-B--master-data=2-x--events |gzip >/opt/mysql.all.gzIf the hybrid engine is dominated by InnoDB;
the parameters that are common in the mysqldump backup command are:-A back up the entire database; Note add:--events;-B increase the command to create the database and connect to the data base , and specify m
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.