MySQL Backup Database FAQ

Source: Internet
Author: User
Tags mysql backup mysql backup database

If you encounter mysqldump:unknown option '--no-beep ', you can add--no-dafaults

No semicolon required at end of command

Mysqldump--no-defaults-uroot-  p--databases S8 > S888888.sql

1. Export all databases

This command exports all databases, including the system database

Mysqldump-uroot-proot--all-databases >/tmp/all.sql

2. Export all data for DB1, DB2 two databases

Mysqldump-uroot-proot--databases db1 DB2 >/tmp/user.sql

3. Export only table structure does not export data,--no-data

Mysqldump-uroot-proot--no-data--databases db1 >/tmp/db1.sql

4. Create a database with an export file

 

# On the command line Mysql–uroor–p Db1.sql < DB1

stored procedure generates 1 million data: [SQL] View plain copybegin  DECLARE i INT;  START TRANSACTION;  SET I=0;  While I<1000000 does      INSERT into T_user VALUES (Null,concat (i+1,'@xxg. com '), i+1);      SET i=i+1;  END while;  COMMIT;  END  
stored procedure generates 1 million data

MySQL Backup Database FAQ

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.