How to run the mysql backup and recovery command in Windows _ MySQL

Source: Internet
Author: User
Tags mysql backup
How can I run the mysql backup and recovery command in Win? assume that mysql is installed on a c: disk, the mysql database username is root, the password is 123456, the database name is database_name, and in d: the backup database is stored under the root directory. the backup database name is backup20070713. SQL (20070713. SQL indicates the backup date)

Back up the database:

Mysqldump-uroot-p123456 database_name> d:/backup20070713. SQL

Restore database:

Delete the original database, create a database, and import the backup database.

Mysqladmin-uroot-p123456 drop database_name

Mysqladmin-uroot-p123456 create database_name

Mysql-uroot-p123456 database_name

Note: Before importing a backup database, if database_name does not exist, you need to create it. it must be the same as the database name in backup20070713. SQL to import the database.

Note: Windows command line

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: 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.