Mysql executes SQL file commands

Source: Internet
Author: User

Mysql executes SQL file commands

* ********** Execute an SQL file in the mysql command line ***********

C: \ Windows \ system32> cd E: \ MySQL \ mysql-5.7.16-winx64 \ bin // switch the directory to the directory where the binfile of mysql is located

C: \ Windows \ system32> mysql-uroot-p520462-Dtest

// Mysql-u account-p password-D database name <absolute path of the SQL File

Mysql: [Warning] Using a password on the command line interface can be insecure.

Article dealer price

0001 a 3.45

0001 B 3.99

0002 a 10.99

0003 B 1045.00

0003 c 1.69

0003 d 1.25

0004 d 19.95

Mysql> source E: \ test. SQL // run source E: \ test. SQL on the mysql Console

Database changed

ERROR:

No query specified

+ --------- + -------- + --------- +

| Article | dealer | price |

+ --------- + -------- + --------- +

| 0001 | a | 3.45 |

| 0001 | B | 3.99 |

| 0002 | a | 10.99 |

| 0003 | B | 1045.00 |

| 1, 0003 | c | 1.69 |

| 1, 0003 | d | 1.25 |

| 1, 0004 | d | 19.95 |

+ --------- + -------- + --------- +

7 rows in set (0.00 sec)

Mysql> \. e: \ test. SQL // \. e: \ test. SQL

Database changed

ERROR:

No query specified

+ ------ + ------- + ------ +

| Year | month | day |

+ ------ + ------- + ------ +

| 2000 | 01 | 01 |

| 2000 | 02 | 20 |

| 2000 | 01 | 30 |

| 2000 | 02 | 02 |

| 2000 | 02 | 23 |

| 2000 | 02 | 23 |

+ ------ + ------- + ------ +

6 rows in set (0.00 sec)

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.