Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are several methods from MySQL to CSV

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

MySQL to CSV several methods are, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Data export and import, the most commonly used method:

Export:

Provincial resource-based:

Mysql-e "select * from aa"-s-s > aa.txt

Import:

Load data infile'/ tmp/user_type_2017-08-21.txt' into table aa fields terminated by'\ t'

# # cost source:

SET NAMES "utf8"

Select * from ricci_var into outfile'/tmp/var.csv' fields terminated by', 'optionally enclosed by' "'lines terminated by'\ n'

Import:

SET NAMES "utf8"

Load data infile "/ tmp/var.csv" into table ricci_var fields terminated by', 'optionally enclosed by' "'lines terminated by'\ n'

In some special cases, it is impossible to do this, such as junk RDS, which is required:

Export:

Usr/local/mysql/bin/mysql-h292.168.1.10-udlan-proot123 test-e "SELECT * FROM manufactor_user_info where date (create_time)

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report