MySQL database backup command1. Export the entire databaseThe exported files are stored in the mysql \ bin directory by default.Mysqldump-u username-p database name> exported file nameMysqldump-u user_name-p123456 database_name> outfile_name. SQL2. Export a tableMysqldump-u
Using MYSQL for database backup is also a regular database backup method. It has the same concept as other database servers, but have you ever thought about it, mySQL will have a simple
Whether because MySQL is too big, back and forth backup waste resource bandwidth and worry, if you want to solve this problem requires incremental backup, the following is the Zhangxiao resource Network modified a MySQL incremental backup script, I have made the relevant com
Restore 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 nameThe following is a test in the program$command = "Mysqldump–opt-h $dbhost-u $dbuser-P $dbpass $dbname | gzip > $backupFile ";$command = "Mysqldump-h
script usage: to back up a database, add a Backup command after the script, as shown below:
Backup_db 10.90.5.50 dbname mysql 123456 innodbFunction Name mysql IP address database name to be backed up Connection database Username
MySQL is the most well-known open source database system for interactive website development. If you are using a MySQL database, you should regularly back up data to prevent data loss ). There are 10 methods to automatically or manually back up the MySQL
The most common method for mysql database backup is to directly use the mysqldump command, but the disadvantage of this command is that it takes a long time for big data, therefore, many webmasters directly use the copy database for fast backup and recovery.
Functions provid
name-uroot-p > Xxx.sql4. Export the structure of a specific tableMysqldump-uroot-p-B database name--table table name > Xxx.sqlRestore-Restore:Restore all Databases 2 methods: (Requires a backup set of the database)(1) MySQL command line source method(1) MySQL command line:
1. System Environment Description:1. Two database servers, A and B;2. Currently, A is in use and serves as the master server. B is used as the backup database server;3. The database for Hot Backup contains data tables of MyISAM and InnoDB type;
Ii. Operation Process descript
Backup scheme for MySQL database using the Percona-xtrabackup toolNeed to back up the MySQL host 172.16.155.23Host 172.16.155.22 for backup MySQLPurpose: The MySQL database on the 155.2
Use MySQL for database backup, and very formal database backup method, with other database servers have the same concept, but have not thought, MySQL will have a simpler use of the file
This article mainly introduces the conditions required to create a database backup after the automatic backup in the MySQL database and the restoration after the MySQL database is damag
Tags: file name import data unzip Tor term res SQL file prompt wordRestore a database: mysql-h localhost-u root-p123456 www Backing up a database: mysqldump-h localhost-u root-p123456 www > d:\www2008-2-26.sql Where www is the database name The following is a test in the program $command = "Mysqldump–opt-h $dbhost-
Look at the Backup class file first
backdata.class.php:
The code is as follows
Copy Code
/*** Simple one MySQL backup data class**/Class backupdata{Private $mysql _link;//Link identificationPrivate $dbName; Database namePrivate $dataDir; The dir
, even those machines with different hardware structures. Directly copying files cannot be transplanted to other machines, unless the table you are copying usesMyISAMStorage format.ISAMTables can only be copied on machines with similar hardware structures. InFor MySQL 3.23Introduced inMyISAMThe table Storage Format solves this problem. Because the format is machine-independent, you can directly copy files to machines with different hardware structures
You can put this script into the crontab, his configuration file in the/etc/crontab every morning, the automatic backup of this script only once a day, and keep only the last five days of backup on the server.
The code is as follows
Copy Code
#!/bin/bash#This is a shellscript for Auto DB Backup#Powered by Aspbiz#2004-09 #Setting#设置数据库
Using MYSQL for database backup is also a regular database backup method. It has the same concept as other database servers, but have you ever thought about it, mySQL will have a simple
Mysql database backup and recovery command mysqldump, source usage, you can refer.
Mysql database backup and recovery command mysqldump, source usage, you can refer.
Restore A Database
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.