echemi logo
Product
  • Product
  • Supplier
  • Inquiry
    Home > How to backup and restore MySQL database with mysqldump command?

    How to backup and restore MySQL database with mysqldump command?

    • Last Update: 2020-04-03
    • Source: Internet
    • Author: User
    Search more information of high quality chemicals, good prices and reliable suppliers, visit www.echemi.com
    Mysqldump is an effective tool for backing up MySQL database It creates a * SQL file with drop table and inserts the SQL representation of the source database when creating the table To restore a database, execute * SQL files on the target database With mysqldump command, you can back up the local database and restore it on the remote database This article will show you several instances of backing up and restoring a database using msqldump The following two commands are the basic commands for backing u p and restoring a database: Backup: ා mysqldump - U root - P [password] [database name] > beifenwenjian.sql restore: # MySQL - U root - P [password] [database name] < beifenwenjian.sql 1 Back up a single database This example tells you how to back u p the database and output the file: mysqldump - U root - P tmppassword > jing.sql - mysqldump - U root - P [password] [database name] > beifenwenjian.sql 2 Back up multiple databases Before starting the backup, first identify the database to be backed up Suppose you want to back u p both SugarCRM and bugs databases at the same time, execute the following mysqldump command: 3535; mysqldump - U root - P password - databases bugs SugarCRM > bugs_sugarcrm.sql 3 Back up all databases The following is an instance of backing u p all databases: 3535; mysqldump - U root - P password - All Databases > / TMP / all database SQL 1 Restore a database in this instance, execute the following MySQL command When restoring the dumpfilename.sql file on a remote database, make sure to create a SugarCRM database before restoring #MySQL - U root - P password MySQL > create database SugarCRM; query OK, 1 row affected (0.02 sec) ා MySQL - U root - P password SugarCRM < / TMP / sugarcrm.sql # MySQL - U root - P [password] [database name] < dumpfilename.sql
    This article is an English version of an article which is originally in the Chinese language on echemi.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or complaint, to service@echemi.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.

    Contact Us

    The source of this page with content of products and services is from Internet, which doesn't represent ECHEMI's opinion. If you have any queries, please write to service@echemi.com. It will be replied within 5 days.

    Moreover, if you find any instances of plagiarism from the page, please send email to service@echemi.com with relevant evidence.