17
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AmazonRDSのテーブルをCSV形式でエキスポートする

Last updated at Posted at 2015-07-07

問題

Amazon RDSは、SELECT ... INTO OUTFILEが使えない。

The "SELECT ... INTO OUTFILE" command creates a file on the database server.  MySQL does not provide a way to use this command to create a file on the client. 

解決

mysqldump_to_csv.pyを使うことで、CSVで出力ができた。

コマンドのインストール

$ wget https://raw.githubusercontent.com/jamesmishra/mysqldump-to-csv/master/mysqldump_to_csv.py

CSVの出力

$ mysqldump -u username -p --host=rdshostname database table | python mysqldump_to_csv.py > table.csv

転載元

Exporting table from Amazon RDS into a csv file

17
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?