In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how MYSQL uses infile/outfile. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
As the existing employer requires the use of MYSQL database, so recently also began to further research on MYSQL database, the first intervention is, of course, some normal applications:
The flexibility of outfile/infile:
Today, when we come into contact with outfile and infile under mysql, it feels very appropriate and actual use. Unlike ORACLE, any operation has to be encapsulated into its own interface to achieve and operate. MYSQL directly completes the import and export of data through a simple statement, satisfying daily flexibility and controllability.
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name.txt' [REPLACE | IGNORE] INTO TABLE tbl_name [FIELDS [TERMINATED BY' string'] [[OPTIONALLY] ENCLOSED BY 'char'] [ESCAPED BY' char']] [LINES [STARTING BY 'string'] [TERMINATED BY' string']] [IGNORE number LINES] [(col_name_or_user_var) .)] [SET col_name = expr,...)] demo: example file: e.txt==1 21 21 23 41 23 43 4 examples: e.txt==1 21 21 23 41 23 43 4 magic Magicum > load data infile 'dburee.txt'into table test1;Query OK, 7 rows affected (0.13 sec) Records: 7 Deleted: 0 Skipped: 0 Warnings: 0mysql > load data infile 'dpiste.txt'replace into table test1;Query OK, 7 rows affected (0.06 sec) Records: 7 Deleted: 0 Skipped: 0 Warnings: 0mysql > load data infile 'dpurab' replace into table test1 FIELDS TERMINATED by', 'LINES TERMINATED by' '; Query OK, 2 rows affected (0.09 sec) Records: 2 Deleted: 0 Skipped: 0 Warnings: 0mysql > load data infile'dvie e.txt' replace into table test1 FIELDS TERMINATED by', 'LINES TERMINATED by'; 'ignore 2Query OK, 0 rows affected (0.00 sec) Records: 0 Deleted: 0 Warnings: 0outfilemysql > select * into outfile'dburet out1.txt' from test1;Query OK, 23 rows affected (0.00 sec) mysql > select * into outfile'dpurl out2.txt`FIELDS TERMINATED by', 'from test1-> Query OK, 23 rows affected (0. 00 sec) mysql > select * into outfile'ddisplay out3.txt 'FIELDS TERMINATED by', 'lines terminated by'; 'from test1->; Query OK, 23 rows affected (0.02 sec) Thank you for reading! This is the end of this article on "how MYSQL uses infile/outfile". 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, you can 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.