MySQL Execute SQL file

Source: Internet
Author: User

Mysql-uspider_55haitao-pspider_55haitao-dspider_55haitao

method One executes with the cmd command (under Windows, UNIX or Linux under its console)
"MySQL Bin directory" \mysql–u user name –p password –d database < "SQL script file path full name" Example:
D:\mysql\bin\mysql–uroot–p123456-dtest<d:\test\ss.sql
Attention:
A, if the use database is used in a SQL script file, the-d database option can be ignored
B, if "MySQL Bin directory" contains spaces, you need to use "" "include, such as:" C:\Program files\mysql\bin\mysql "–u username –p password –d database <" SQL script file path full name "

method Two after entering MySQL console, use the source command to execute
Mysql>source "path full name of SQL script file" or mysql>\. "Path full name of SQL script file", example:
source D:\test\ss.sql or \. D:\test\ss.sql

MySQL Execute SQL file

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.