Design and write some design considerations for this script:
This script is suitable for compiling and installing MySQL and installing via yum or Apt-get
The script can be executed repeatedly without overwriting the data repeatedly
Can be added to save disk space by removing backups from N days ago
Make full use of mysqldump's self-locking table function, refresh log, copy and other functions
Scripts for backing up the
slave database (to be implemented)
2. Install Xtrabackup on the master database
yum install perl-Time-HiRes*yum install perl-DBD-MySQL -ywget http://www.percona.com/redir/downloads/XtraBackup/LATEST/RPM/rhel6/x86_64/percona-xtrabackup-2.1.9-744.rhel6.x86_64.rpmrpm -ivh percona-xtrabackup-2.1.9-744.rhel6.x86_64.rpm
3. Back up the master
The following articles mainly introduce the actual operation solutions for database backup on the MySQL platform, including the mysqldump program, direct copy of database files, and a detailed description of the advantages and disadvantages of the two solutions, the following describes the main content of the article.
1, mysqldump1.1 BackupMysqldump is a SQL-level backup mechanism that guides data tables into SQL script files and is relatively appropriate for upgrades between different versions of MySQL, which is also the most common method of backup. Now let's talk about some of the main parameters of mysqldump:
--compatible=nameIt tells Mysqldump which
Label:Because MySQL has a variety of database backup methods, and each has its pros and cons, for us beginners, choosing the right backup method is indeed a bit difficult. Personally think, first of all, based on the company's needs, consider the ability to tolerate the loss of data, the cost of labor costs, and so on,
MySQL database backup and recoveryRestore a database: mysql-h localhost-u root-p123456 wwwBacking up a database: mysqldump-h localhost-u root-p123456 www > d:\www2008-2-26.sqlWhere www is the
database) is still the best cold backup, and the speed is fast, it is also the best way to ensure data consistency, but today this situation does not seem to work, Xtrabackup !!!
2. Learn about Xtrabackup
Xtrabackup:1. fast and reliable backup; 2. uninterrupted transaction processing during Backup; 3. Saving disk spac
Database Backup is crucial. previous articles also explained how to back up MySQL and how to set up the master-slave synchronization policy, synchronization and backup of MySQL, we often think that master-slave synchronization can also be used as a
saved directly to a remote machine (useful when the local hard disk space is insufficient)
The tools provided by the MySQL database itself do not support real Incremental backup. binary log recovery is point-in-time recovery rather than Incremental backup.The Xtrabackup tool supports Incremental backup of the InnoDB S
Linux command line backup mysql database
Back up MySQLDatabaseCommand
1
Mysqldump-hhostname-uusername-ppassword databasename> backupfile. SQL
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] Next page
[Statement]: the black bar Safety Network (http://www.myhack58.com) published this article for the purpose of transmitting more information, do
How to exclude the specified database during MySQL backup.
When you use the mysqldump command to back up data, -- all-databases can back up all databases. You can use ignore-table to exclude the specified table. However, mysqldump does not have any parameter to exclude the database.
If the number of databases to be bac
convenient.2. Step 1 of the above-mentioned export3. Enter MySQL: mysql-u username-pFor example, the command line I entered is mysql-u root-p. (After entering the same password, you will be asked to enter the MySQL password)4. Create the database you want to create in
Tags: first step named user www Mon sql command Pass reference MonthlyOne, MySQL data backup 1.1, mysqldump command backup dataProvides a handy tool for command line export of database data and files in MySQL mysqldump, we can directly implement the export of
Below is a PHP database backup source code, you can also according to their own needs to modify.
Backing up a database$host = "localhost";$user = "root"; Database account$password = ""; Database Password$dbname = "MySQL";
Tags: mysql innodb xtrabackupMySQL database backup and recovery background:As an operations engineer, often encounter hardware failure (redundancy), software failure (bug), natural disaster, hacker attacks, misuse of the database to destroy the problem, so be sure to do a good job of
Back up the MySQL database with one click and save the following code as a. bat file.
@ Echo off
Echo.
Echo MySQL database backup
Echo *****************************
Echo.
Echo today is % date %
Echo time is % time %
Echo.
Echo *****************************
Se
--socket=/var/lib/mysql/mysql.sock/data/backupDescriptionThe 1.--defaults-file=/etc/my.cnf file must be in the front2.--user=root--password=root,--use=*** and--password=*** must have a space in the middle,For example, complete backup completeFor example, a full backup creates a file named after a date (month, day, minutes, minutes, seconds, YYYY-MM-DD_HH-MM-SS)Th
First, the common operation:
Back up the entire database
Format:MYSQLDUMP-H host name-P Port-u username-p password (–database) database name > filename. sqlMysqldump-h{hostname}-p{port}-u{username}-p{password} {DatabaseName} > {backupfile.sql}For example:The code is as follows:
The code is as follows
Copy Code
mysqldump-hlocalhost-p
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.