Get the App
SLTechnology News&Howtos  ›  Database  › 

What are several methods from MySQL to CSV

Shulou Source: shulou.com Published: 2022-05-31 17:30:02 10月03日 Update

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)

Tags: Data methods problems directories methods errors tips content more permissions resources resource-based cleaning special security helpless for this reason can be passed garbage Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno macOS Redmi Shulou Tech Info