statement. Mysqldump-uroot-p–host=localhost–all-databases–no-create-db–no-create-info,-t exports only data without adding the Create TABLE statement. Mysqldump-uroot-p–host=localhost–all-databases–no-create-info–no-data,-D does not export any data, only the database table structure is exported. Mysqldump-uroot-p–host=localhost–all-databases–no-data–password,-P c
} { Databasename3} > Multibackfile.sqlFor example:The code is as follows:
The code is as follows
Copy Code
Mysqldump-hlocalhost-uzhuchao-p123456–databases db_test1 db_test2 db_test3 > Multibackfile.sql
Just back up the database structureFormat: mysqldump–no-data–databases {databasename1} {databasename2} > {structurebackfile.sql}For example:The code is as follows:
Mysqldump backup and recovery mysql database mysqldump
BitsCN.com
Mysqldump is an effective tool to backup MySQL database. it creates *. SQL file with DROP table, CREATE table and INSERT into SQL-statements of the source database. to restore the database, execute *. SQL file on destination database. for MyISAM, use m
Mysqldump is an effective tool to backup MySQL database. it creates *. SQL file with DROP table, CREATE table and INSERT into SQL-statements of the source database. to restore the database, execute *. SQL file on destination database. for MyISAM, use mysqlhotcopy method that we explained earlier, as it is faster for MyISAM tables.
Using mysqldump, you can backup
The mysqldump command is a very good database operation command in mysql. It can back up and restore the database, and is used in almost all database command backups, next I will introduce some usage of mysqldump.
I. Common Operations:
Back up the entire database
Format:Mysqldump-h host name-P port-u user name-p password (-database) database Name> file name. SQLM
Back up and restore a MySQL database using mysqldump
Mysqldump [Options] database [Tables]If no table is specified, the entire database is exported.
Command for backing up MySQL database Mysqldump-hhostname-uusername-ppassword databasename> backupfile. SQL
Back up the MySQL database in the format of a table with
opposite effect to the load DATA infile command, which is the SELECT INTO OutFile command. There are many similarities between the two commands. First, they have almost the same options. Now you need to complete the previous function with mysqldump
Okay, here's a detailed introduction to the mysqldump data backup and restore barCommands for backing up the MySQL
We will certainly encounter the backup database in the course of running the project, restore the database situation, we generally use two ways to deal with:1. Import and export backup data using into outfile and load data infileThe advantage of this method is that the exported data can be self-defined format, and the export is pure data, there is no table information, you can directly import another database with the different tables, compared to
Label:Original http://www.cnblogs.com/xuejie/archive/2013/01/11/2856911.html We will certainly encounter the backup database in the course of running the project, restore the database situation, we generally use two ways to deal with: 1. Import and export backup data using into outfile and load data infile The advantage of this method is that the exported data can be self-defined format, and the export is pure data, there is no table information, you
How to Use mysqldump to back up and restore a specified table
How to Use mysqldump to back up and restore a specified table
The Code is as follows:
Mysqldump-u user-p db tab1 tab2> db. SQL
Restore
The Code is as follows
=option,--set-variable var=option Sets the value of a variable. The possible variables are listed below.-V,--verboseVerbose mode. Print out more information about what the program is doing.-V,--versionPrint version information and exit.-W,--where= ' where-condition '
mysqldump Backup Restore and mysqldump Import Export statements Daquan detailed
one. mysql backup command:1. Backing up a single databasemysql> system mysqldump-uroot-pmybaby99 WordPress >/tmp/wordpress.sql;mysql> system Ls-l/tmp/wordpress.sql;-rw-r--r--1 root root 292760 Oct 18:43/tmp/wordpress.sql2. Compress the backup:[Email protected] mysql]# mysqldump-uroot-pmybaby99 wordpress|gzip >/server/bak/wordpress.sql.gz;[Email protected] mysql]# ll-l/server/bak/wordpress.sql.gz-rw-r--r--1
Mysql, mysqldump, export, export table, compress and export mysql, mysqlhotcopy, and mysql restore table
This article discusses the backup and recovery mechanisms of MySQL and how to maintain data tables, including the two most important types of tables: MyISAM and Innodb. the MySQL version designed in this article is 5.0.22.
Currently, MySQL supports the following free BACKUP tools:
Mysqldump back up and restore a MySQL database
Brief Introduction:
The mysqldump command can be used to export all specified databases and tables as SQL scripts, which can be used on Mysql in different sections. For example, to upgrade the Mysql database, you can use mysqldump to back up all the databases and then impo
=myisamdefaultcharset=utf8;mysql>insert NBSP;INTONBSP;MYISAM_TBL (name) ->values (' One '), (' Joy '), (' Li '), (' Tom '), (' Jerry '), (' Hello ');### a good way to build data mysql>insertintomyisam_tbl (name ) ->selectnamefrommyisam_tbl;### Create a table mysql>createtableinnodb_tbl for the InnoDB engine (-> idINTNotnullauto_increment,->namevarchar (+), ->primarykey (ID) - >) engine=innodbDEFAULTcharset=utf8;# myisam_tbl data to Innodb_ TBL Table MYSQLGT;NBSP;INSERTNBSP;INTONBSP;INNODB_TBL (
table method, you can run the Restore table statement to recover the datasheet. Example:
RESTORE TABLE from \ '/tmp/db_name/\ ';
Permission requirements are similar to those described above.Files backed up with the SELECT into OutFile method can run the LOAD data INFILE statement to recover the datasheet. Example:
LOAD DATA INFILE \ '/tmp/db_name/tbl_name.txt\ ' into TABLE tbl_name;
Permission requirement
following from the command line: Mysqlbinlog--stop-position= "368312"/var/log/mysql/bin.123456 | Mysql-u root-pmypwd mysqlbinlog--start-position= "368315"/var/log/mysql/bin.123456 | Mysql-u root-pmypwd \ The 1th row above will revert to all transactions until the stop location. The next line restores all transactions from the given starting position until the end of the binary log. Because the output of Mysqlbinlog includes a set TIMESTAMP statement before each SQL statement is recorded, the re
Tags: blog class code tar ext intWe will certainly encounter the backup database in the course of running the project, restore the database situation, we generally use two ways to deal with:1. Import and export backup data using into outfile and load data infileThe advantage of this method is that the exported data can be self-defined format, and the export is pure data, there is no table information, you can directly import another database with the
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.