Windows Import Export backup MySQL database command line

Source: Internet
Author: User
Tags import database mysql command line

Backup

1 Start Menu | Run | cmd |

650) this.width=650; "title=" 1.png "src=" http://s4.51cto.com/wyfs02/M02/88/8D/ Wkiom1f7whcws2vfaaa8xm7hwl8788.png-wh_500x0-wm_3-wmp_4-s_2679191702.png "alt=" Wkiom1f7whcws2vfaaa8xm7hwl8788.png-wh_50 "/>

2 MySQL command line export database: Go to the Bin folder in the MySQL directory: cd MySQL to the Bin folder directory as I entered the command line: CD D:\mysql-5.6.24-win32\bin

(or add the directory to the Windows environment variable path directly)

650) this.width=650; "title=" 1.png "src=" http://s2.51cto.com/wyfs02/M02/88/8D/ Wkiom1f7w1jgdxa3aaakwuewiue108.png-wh_500x0-wm_3-wmp_4-s_4135153844.png "alt=" Wkiom1f7w1jgdxa3aaakwuewiue108.png-wh_50 "/>

3 Export Database: Mysqldump-u username-P database name > exported file name as I entered the command line: Mysqldump-u root-p yyp > Yyp.sql (Input will let you enter the password into MySQL) (if the export Single-Sheet words, enter the table name after the database name.

650) this.width=650; "title=" 1.png "src=" http://s1.51cto.com/wyfs02/M01/88/8E/ Wkiom1f7xhfzsf1haaarzwc1jo4596.png-wh_500x0-wm_3-wmp_4-s_1480061752.png "alt=" Wkiom1f7xhfzsf1haaarzwc1jo4596.png-wh_50 "/>

4 will see the file Yyp.sql automatically generated to the bin file under the command line Import database:

650) this.width=650; "title=" 1.png "src=" http://s2.51cto.com/wyfs02/M02/88/8E/ Wkiom1f7xrazkj2zaagyzx4xkhu417.png-wh_500x0-wm_3-wmp_4-s_4139794609.png "alt=" Wkiom1f7xrazkj2zaagyzx4xkhu417.png-wh_50 "/>

Restores

1 Enter "Mysql>", enter the command "show databases;", enter to see what database;

650) this.width=650; "title=" 1.png "src=" http://s4.51cto.com/wyfs02/M01/88/8E/ Wkiom1f7x1zz2vl3aaam59gvdfe856.png-wh_500x0-wm_3-wmp_4-s_3483201454.png "alt=" Wkiom1f7x1zz2vl3aaam59gvdfe856.png-wh_50 "/>

2 Set up the database you want to restore, enter "CREATE Database yyq;", carriage return; 650) this.width=650; "title=" 1.png "src=" http://s2.51cto.com/wyfs02/M00/88/ 8e/wkiom1f7x8uiifhraaaeqhhtmbi811.png-wh_500x0-wm_3-wmp_4-s_969923462.png "alt=" Wkiom1f7x8uiifhraaaeqhhtmbi811.png-wh_50 "/>

3 Switch to the database you just created, enter "use voice;", carriage return;

650) this.width=650; "title=" 1.png "src=" http://s4.51cto.com/wyfs02/M00/88/8A/ Wkiol1f7yjbitux5aaackwquzmi247.png-wh_500x0-wm_3-wmp_4-s_2448805423.png "alt=" Wkiol1f7yjbitux5aaackwquzmi247.png-wh_50 "/>

4 Import data, enter "source Yyp." SQL; ", enter, start import," mysql> "again, and the restore succeeds without prompting the error.

650) this.width=650; "title=" 1.png "src=" http://s2.51cto.com/wyfs02/M00/88/8B/ Wkiol1f7ytnj6hg1aaa1taxzohw696.png-wh_500x0-wm_3-wmp_4-s_2123613653.png "alt=" Wkiol1f7ytnj6hg1aaa1taxzohw696.png-wh_50 "/>

5 Import Succeeded

650) this.width=650; "title=" 1.png "src=" http://s2.51cto.com/wyfs02/M01/88/8E/ Wkiom1f7y8owzpkqaaawdof0xe4301.png-wh_500x0-wm_3-wmp_4-s_2039819484.png "alt=" Wkiom1f7y8owzpkqaaawdof0xe4301.png-wh_50 "/>

Windows Import Export backup MySQL database command line

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.