In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to use mysqlimport to import data into mysql. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
1. Prepare to import data
[root@D2-LZY245 ~] # cat / tmp/emp.txt
100,Steven,King,24000.00
101,Neena,Kochhar,17000.00
102,Lex,De Haan,17000.00
103,Alexander,Hunold,9000.00
104,Bruce,Ernst,6000.00
105,David,Austin,4800.00
106,Valli,Pataballa,4800.00
107,Diana,Lorentz,4200.00
108,Nancy,Greenberg,12008.00
109,Daniel,Faviet,9000.00
110,John,Chen,8200.00
2. Create InnoDB engine table
Mysql > create database test1
Query OK, 1 row affected (0.00 sec)
Mysql > use test1
Database changed
Mysql > create table emp (
-> employee_id int (10)
> first_name varchar (50)
> last_name varchar (50)
-> salary decimal (10jue 2) engine=innodb charset=utf8
Query OK, 0 rows affected (0.00 sec)
3. Import data
[root@D2-LZY245] # mysqlimport-uroot-pendant 123456' test1-- default-character-set=utf8-- fields-terminated-by=',' / tmp/emp.txt
Mysqlimport: [Warning] Using a password on the command line interface can be insecure.
Test1.emp: Records: 11 Deleted: 0 Skipped: 0 Warnings: 0
4. View the results
Mysql > select * from emp
+-+
| | employee_id | first_name | last_name | salary | |
+-+
| | 100 | Steven | King | 24000.00 | |
| | 101 | Neena | Kochhar | 17000.00 | |
| | 102 | Lex | De Haan | 17000.00 | |
| | 103 | Alexander | Hunold | 9000.00 | |
| | 104 | Bruce | Ernst | 6000.00 | |
| | 105 | David | Austin | 4800.00 | |
| | 106 | Valli | Pataballa | 4800.00 | |
| | 107 | Diana | Lorentz | 4200.00 | |
| | 108 | Nancy | Greenberg | 12008.00 | |
| | 109 | Daniel | Faviet | 9000.00 | |
| | 110 | John | Chen | 8200.00 | |
+-+
11 rows in set (0.00 sec)
This is the end of this article on "how to import data into mysql using mysqlimport". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.