[db_name2 ...] > My_databases.sqlIf you want to dump all databases, use the--all--database option:shell> mysqldump--all-databases > All_databases.sqlIf the table is stored in the InnoDB storage engine, Mysqldump provides a way to back up online (see the command below). This backup requires a global read lock on all tables at the start of the dump (using flush tables with read lock). After the lock is acqui
MySQL database backup tools are many, but here is a small and easy to use the Mysqldump tool, located in the database directory Bin/mysqldump.exe. These days with phpMyAdmin back up the database when there are garbled, Repeated in the local and remote DreamHost space to test the database, but still export the database will appear garbled, should be the problem of phpMyAdmin, the database itself is not a problem. Pull away, hehe. I google about the
statements, even if there are a large number of statements, it will not notice the lock period.shell> mysqldump--all-databases--single-transaction > All_databases.sql for Point-to-point recovery (also known as "roll Forward", When you need to restore an old backup and replay subsequent changes to that backup, it is useful to loop the binary log or at least know the binary log content of the dump:shell>
--single-transaction option. )--hex-blob (use hexadecimal format to export binary string fields.) This option must be used if you have binary data. The field types affected are BINARY, VARBINARY, BLOB. )--extended-insert = True|false (by default, mysqldump turns on--complete-insert mode, so if you don't want to use it, use this option to set its value to false.) ) MySQL Restore:Normal backup Restore MySQL d
db_name | MySQL--host=remote_host-c db_name
You can dump several databases with one command:shell> mysqldump---database db_name1 [db_name2 ...] > My_databases.sql
If you want to dump all databases, use the--all--database option:
shell> mysqldump--all-databases > All_databases.sql
If the table is saved in the InnoDB storage engine, Mysqldump provides a way to
Just back up the database structure
The code is as follows
Copy Code
Mysqldump--no-data--databases databasename1 databasename2 databasename3 > Structurebackupfile.sql
Back up all databases on the server
The code is as follows
Copy Code
Mysqldump--all-databases allbackupfile.sql Restore
When using mysqldump to back up MySQL, the backup file is a text file in SQL format, which consists of a series of createtable and insert statements. To restore the SQL file
When using mysqldump to back up MySQL, the backup file is a text file in SQL format, which consists of a series of create table and insert statements. To
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: mysql-h localhost-u root-p123456 www
Back up a database: mysqldump-h localhost-u root-p123456 www> d: \ www2008-2-26. SQL
// Tes
Basic import of the database \ Export command is mysqldump and source under Linux directly with the command line operation can be under windows under normal circumstances there are two ways one is to use the command line and the other is to use phpMyAdmin
First of all, phpmyadmin. This tool is simple to export and import without having to build a library directly to restore the original database with sour
Mysqldump can be used to back up and restore databases. By default, mysqldump creates droptable, createtable, and insertinto SQL statements.
Mysqldump can be used to back up and restore databases. By default, mysqldump creates dro
127.0.0.1 test B-d> B _test. SQL
Ii. Database Import
1. Import Method
Mysql command line import:
Mysql> source/data/test. SQL
System Command Line import:
Mysql-uroot-p
2. Restore a single database (you must specify a database)
Mysql> use test
Mysql> source/data/test. SQL
3. Restore multiple databases (you do not need to specify a database)
Mysql-uroot-p
Using mysq
restore it. No error was reported, and the view was also restored: # mysql backup and restoration in windows, you do not need to modify my. ini to restore the view (verified) mysqldump-uroot-p123 -- default-character-set = gbk -- opt -- extended-insert = false -- triggers-R -- hex-blob-x db_name> f: \ db. SQL mysql-uroot-p123-f db_name -- Default-character-set =
:
mysqldump--single-transaction--flush-logs--master-data=2 > Backup.sql
This generates an incremental binary log file, such as mysql-bin.000003, to recover the data as follows:
Shell> mysql-uroot-ppwd
In addition Mysqlbinlog can also specify--start-date 、--stop-date 、--start-position and--stop-position parameters, Used to recover data accurately before a certain point in time or to skip the middle of a problem period of reco
SQL statement to the production database.
Import the database to the test server:
Shell>/usr/local/mysql/bin/mysql-uroot-pmysql -- database = csf
Export a single table from the test server:
Shell>/usr/local/mysql/bin/mysqldump -- user = root-pmysql -- port = 3306 -- default-character-set = utf8 -- single-transaction = TRUE "csf "" tmp_excel_data_000728 ">/tmp/mysqlbackup/backup_20101215_single_table_013. SQL
Import this table record to the produc
hellodb table to restore the database in time when the database fails or is deleted by mistake.
The backup solution is to completely back up the database every Sunday and incrementally back up the database from Monday to Saturday.The backup process is as follows:
Backup on the first day: the hellodb database is fully backed up, and the table and scroll binary logs are locked during full backup.
[root@MariaDB~]# m
one command to back up mysql and test multiple databases:
mysqldump -u root -p123456 --database mysql test > my_databases.sql
The generated SQL file contains the statement for creating database mysql and test.
Back up all databases:
mysqldump -u root -p123456 --all-databases > all_databases.sql
Export the structure of the mysql database
mysqldump -u r
--all-databases >/backup/mysql/full/mysql_20110104_195546.sql(4) Set crontab task, execute backup script dailyShell> crontab–e#每个星期日凌晨3:00 Perform a full backup script0 3 * * 0/usr/scrpit/mysqlfullbackup.sh>/dev/null 2>1#周一到周六凌晨3:00 do an incremental backup0 3 * * 1-6/root/mysqlbackup/mysqldailybackup.sh >/dev/null 2>1(5) Clear the old backup file.Go to see the backup disk space and delete the old backup compressed files every day.3, Database recoveryNote if the "error1051 (42S02) at line 32:unk
There are many MySQL database backup tools, but here we will introduce a small and easy-to-use mysqldump tool, which is located in the database directory bin/mysqldump.exe. in the past few days, when phpMyAdmin is used to back up the database, garbled code occurs, and the database is repeatedly tested in the local and remote dreamhost space. However, garbled code occurs when exporting the database. It should be a problem with phpMyAdmin, there is no p
Mysqldump is a database backup programUsage: mysqldump [options] [db_name [Tbl_name ...]Description: Mysqldump is the work of a client-side logical backup that can be restored on other MySQL servers by a backup of the SQL file.For backup, you need at least SELECT permission on the table, the backup view needs to change the account has Show view permission, the tr
Experiment document: Process: Create a table-backup-simulate downtime (delete a table)-restore a backup-restore the current data.1. Restore and restore the experiment
Create a database and use the drop statement to simulate database downtime. Use mysqldump and musqlbinlog to
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.