MySQL mysqldump is used for export. The basic usage is as follows:
Shell> mysqldump [Options] database [Tables]
If you do not specify any tables, the entire database will be exported.
Run mysqldump -- help to obtain the option table supported by your mysqldump version.
Note: If you run
Mysqldump: There are three ways for the database backup program to call mysqldump: mysqldump [options] db_name [tables] mysqldump [options] --- databaseDB1 [DB2DB3...] mysqldump [options] -- all -- database if no table is specified or --- database or -- all -- d is used
Label:When the database is operational in the current network, the database should be hot prepared frequently. One way to ensure data integrity and consistency during recovery is to lock the table before the backup, but the lock table can affect the running business. Mysqldump is the most commonly used backup tool in MySQL, and you can see many options with Mysqldump--help. After
Label:This document is implemented in MySQL 5.7 decompression version for example 1. Simply try the next example on window 1. Open the CMD named Line with Administrator privileges and switch to the mysqldump execution program 2. To change the database as an example, in the export path to create an empty file, or th
Mysqldump is a common mysql database tool. We often use it for data and backup, for example, data import and export. This article introduces the code for exporting the most basic database and exporting tables.]
# Mysqldump Database Name> Database Backup name# Mysqldump-A-u username-p Password Database Name> Database Ba
tables. It forces mysqldump to directly output records from server queries rather than cache all records into memory.
-- Routines,-R: export the stored procedure and user-defined functions.
-- Single-transactionThis option submits a begin SQL statement before exporting data. BEGIN does not block any applications and ensures Database Consistency during export. It is only applicable to transaction tables, such as InnoDB and BDB. This option and the --
MySQL has many data import methods, but these are only half of the data transmission, and the other is generally exporting data from the MySQL database. There are many reasons for exporting data. One important reason is that it is used to back up the database. Data is often expensive and must be processed with caution. Regular backup can help prevent valuable data loss. Another reason is that you may want to export data for sharing. Sharing data becomes more and more common in the ever-growing w
file nameMysqldump-u wcnc-p smgp_rj_wcnc users> wcnc_users. SQL
3. export a database structure
The code is as follows:
Mysqldump-u wcnc-p-d -- add-drop-table smgp_apps_wcnc> d: wcnc_db. SQL-D no data -- add-drop-table adds a drop table before each create statement.
4. import the database
Common source commandsGo to the mysql database console,For example
The code is as follows:
Mysql-u root-p
Mysql> us
It is important to back up your database if the database tables are missing or corrupted. If a system crash occurs, you certainly want to be able to recover your table as much as possible with the least amount of data recovered to the state when the crash occurred. Scenario: Perform a full backup every Sunday, mysqldump incremental backup Every 1 o'clock in the afternoonMysqldump Incremental Backup ConfigurationThe prerequisite for performing an incre
option is useful when exporting large tables. It forces mysqldump to directly output records from server queries rather than cache all records into memory.
-T, -- no-create-info only exports data
-D, -- no-data only exports the structure
Certificate ----------------------------------------------------------------------------------------------------------------------------------------------
Phase 3: Create a database and a table for the database
= option to set the value of a variable. Possible variables are listed below.-V, -- verboseLengthy mode. Print out more information about the program.-V, -- versionPrint the version information and exit.-W, -- where = 'where-condition'Only selected records are exported. Note that the quotation marks are mandatory!"-- Where = user = 'jimf '"-wuserid> 1 ""-wuserid The most common use of mysqldump may make a backup of the entire database:Mysqldump -- op
exported file is smaller and the import speed is accelerated. The value is enabled by default, and the -- skip-extended-insert cancel option is used.
-- Single-transactionThis option submits a begin SQL statement before exporting data. BEGIN does not block any applications and ensures Database Consistency during export. It is only applicable to multi-version storage engines and only InnoDB. This option and the -- lock-tables option are mutually exclusive, Because lock tables will implicitly com
treated as database names. For example: mysqldump-uroot-p-B test MySQL--de Fault-character-set sets the default character set, and the default value is UTF8.
For example: MYSQLDUMP-UROOT-P–A–DEFAULT-CHARACTER-SET=LATIN1-E,--events export event. -F,--flush-logs refresh the log before starting the export note: If you e
will be prompted to enter the password of the root user name. after entering the password, the dataname database will be successfully backed up in the MySQL/bin/directory.
2. Export a tableMysqldump-u user name-P database name Table Name> exported file nameMysqldump-u root-P dataname users> dataname_users. SQL
3. Export a database structureMysqldump-u wcnc-p-D-add-drop-Table smgp_apps_wcnc> D:/wcnc_db. SQL-D no data-add-drop-table add a drop table before each create statement
4. Import the
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:
Mysql-u user-p db
Refer:
1. copy backup files: (ensure that the database has no write operations (you can lock the Table). Co
Mysqldump is a tool used by mysql for logical backup. During database backup, you need to back up the data and binary files of the database.
Mysqldump is a tool used by mysql for logical backup. During database backup, you need to back up the data and binary files of the database.
Mysqldump is a tool used by mysql for logical backup. During database backup,
console, as - -PMySQL> Use databaseThen use the source command, followed by the script file (for example, the. SQL used here)MySQL>source D:wcnc_db.sqlMySQL uses the source command to import database encoding issuesMysql>use database name (same as your site database name)set names UTF8;(First confirm the coding note is not UTF-8)SOURCE D:123. sql(The name of the database to import)Instance:1, Export tablename table in accordance with field>xxx data f
Tags: Export file Microsoft Jas Black Dump directory RAC http present out CTEhttp://c.biancheng.net/cpp/html/1458.html The mysqldump command is used to back up the database. The mysqldump command executes under the DOS [Url=file://\\mysql\\bin]\\mysql\\bin[/url] directory. 1) Export the entire database (the export file is present in the Mysql\bin directory by default)??
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.