。。。 MySQL batch import SQL file ...

Source: Internet
Author: User

Today, when importing a new database, there are 40 or so tables in it. Internet search a lot of information finally learned, but the network has a lot of information on the correctness of the actual operation to verify its authenticity!

Here is the dry goods:

(1) Create a new file on the desktop--main.sql (you can create a new TXT file and change the file suffix name to SQL).

(2) Open main.sql (through notepad++ Open, no words can go to the network to download a, of course, as long as the ability to open this file, and can edit it, with what software does not matter, I use the notepad++)

(3) After opening the Main.sql file, write the following in it:

/**

Note format

Source (space) SQL file path, path to write \ \, do not write \, and each statement remember to add the English semicolon ";"

When copying, this comment code can be used without copying

**/

SOURCE D:\\sql\\a.sql;source D:\\sql\\b.sql;source D:\\sql\\c.sql;

  

(4) After finishing, save. Then log in to the MySQL command window and run the following command in turn:

show databases;

Select your database

Use your database name;

File path address for source Main.sql

All right! Done! That's how I finished it!

。。。 MySQL batch import SQL file ...

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.