MySQL Backup and restore (Win system +linux system)

Source: Internet
Author: User
Tags mysql backup mysql command line

First, the win system MySQL backup and restore:

1, Backup:

Start-and-run->cmd, go to the MySQL Bin folder:

Mysqldump-u user name-p databasename >exportfilename

Enter a password to export the database.


2, Restore:

Enter the MySQL command line, "Mysql>", to create the database to restore:

Create Database Databasesname;

Go to the database you created, and restore:

Use Databasename;source exportfilename;


Ii. MySQL backup and restore under Linux:

1, Backup:

# mysqldump-u Root-p Databasename>exportfilename.sql

Enter a password to export


2, Restore:

Method 1:

Go to MySQL console and restore using Source:

Mysql>create database Databasename;mysql>use Databasename;mysql>source exportfilename;


Method 2:

To restore using the MySQL command in the shell command line:

Create the database First:

Mysql>create database databasename;mysql>exit;# mysql-u root-p databasename <exportfilename

Enter a password to import

Third, MySQL export the specified table:

# mysqldump-uroot-p DatabaseName Table1>table1.sql


This article is from the "Baiyubao blog" blog, make sure to keep this source http://baiyubao.blog.51cto.com/2845008/1755095

MySQL Backup and restore (Win system +linux system)

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.