In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Select into outfile can export data to a file in a specified directory
Syntax:
SELECT... INTO OUTFILE 'file_name' [CHARACTER SET charset_name] [export_options] export_options: [{FIELDS | COLUMNS} [TERMINATED BY' string'] [[OPTIONALLY] ENCLOSED BY 'char'] [ESCAPED BY' char']] [LINES [STARTING BY 'string'] [TERMINATED BY' string']
2. Examples are as follows:
1) View the table T1 of the data to be exported
Mysql > select * from T1 + | id | name | +-+-+ | 1 | wang | | 2 | steven | | 3 | tiger | | 4 | lilu | +-+-+ 4 rows in set (0.00 sec)
2) View the exported file
[mysql@oneproxy outfile] $more t1.file 1, "wang" 2, "steven" 3, "tiger" 4, "lilu"
3) create table T2 to import
Mysql > create table T2 as select * from T1 where 1, query OK 2, 0 rows affected (0.03 sec)
4) Import the exported data into T2
Mysql > LOAD DATA INFILE'/ mysql/outfile/t1.file' INTO TABLE T2 FIELDS TERMINATED BY', 'ENCLOSED BY' "'LINES TERMINATED BY'\ nquery OK, 4 rows affected (0.01 sec) Records: 4 Deleted: 0 Skipped: 0 Warnings: 0
5) View imported data
Mysql > select * from T2 + | id | name | +-+-+ | 1 | wang | | 2 | steven | | 3 | tiger | | 4 | lilu | +-+-+ 4 rows in set (0.00 sec)
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.