MySQL data import and export methods and tools (2) _ MySQL

Source: Internet
Author: User
MySQL data import and export methods and tools (2) batch processing import files, import data from SQL files to the database, batch processing is a non-interactive method to run mysql programs, like the commands you use in mysql, you will still use these commands.

To implement batch processing, you need to redirect a file to the mysql program. First, we need a text file containing the same text as the command we entered in mysql.

The suffix and any other legal names do not have to end with SQL ):
USE Meet_A_Geek;
Insert into mers (Customer_ID, Last_Name) VALUES (NULL, "Block ");
Insert into mers (Customer_ID, Last_Name) VALUES (NULL, "Newton ");
Insert into mers (Customer_ID, Last_Name) VALUES (NULL, "Simmons ");

Note that the syntax of these sentences must be correct, and each sentence ends with a semicolon. Select the database for the above USE command, and INSERT the command to INSERT data.

Next, we need to import the above files to the database. before importing the files, we need to confirm that the database is running, that is, the mysqld process (or service, which is called "service" under Windows NT). unix is running.

Then run the following command:
Bin/mysql

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.