Import SQL files to MySQL using DOS command

Source: Internet
Author: User

Summarize the method of using the DOS command to operate the MySQL database. Didn't pay much attention to it before. It's quick to find this way. Especially when there is no graphical management tool for MySQL on the server.

(1) First of all to ensure that the command line access to the database, is to configure the environment variable path. Write the path of the bin of the MySQL folder into path;

(2) Then

Mysql-uroot-proot
Note that you cannot add semicolons!!! ;

Enter MySQL database in this way;

(3) then enter the database to be modified, for example, to modify the shop,

Use shop;


Use means that the database can be used.

(4) The SQL file can then be imported into the database named shop in the use environment. To run the command:

SOURCE D:/shop.sql;
Source, as the name implies, is the import resource, followed by the path to the resource. It is best not to have a Chinese path.

Import SQL files to MySQL using DOS command

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.