How MySQL inserts multiple rows of data

Source: Internet
Author: User

    1. Mysql-uroot-p into the database and create a database Hangzhou. Use Hangzhou;

    2. CREATE TABLE t1 (id int (1), name varchar (x), age char (1), Job varchar (20));

    3. To create a file under root 1.txt content is as follows, directly separated by tab:

[Email protected]_168_2_193 ~]# VI 1.txt

1 LX It

4. Then enter the database to execute load data local infile '/root/1.txt ' into table T1;

5. View the results:

Mysql> Show tables;
+--------------------+
| Tables_in_hangzhou |
+--------------------+
| T1 |
+--------------------+
1 row in Set (0.00 sec)

mysql> Load Data local infile '/root/1.txt ' into table T1;
Query OK, 1 row affected, 1 Warning (0.00 sec)
Records:1 deleted:0 skipped:0 warnings:1

Mysql> select * from T1;
+------+------+------+------+
| ID | name | Age | Job |
+------+------+------+------+
| 1 | LX | 2 | it |
+------+------+------+------+
1 row in Set (0.00 sec)



This article is from the "Fluffy Duck" blog, please be sure to keep this source http://woshitieren.blog.51cto.com/2466034/1671684

How MySQL inserts multiple rows of data

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.