hasen's tech life

Twitter: @hasen

MySQLでテーブル定義をCSV形式で出力した.

# MySQLでテーブル定義をCSV形式で出力した.

> select case ordinal_position when 1 then table_name else '' end, column_name, column_type, is_nullable, column_key, column_default, extra from information_schema.columns where table_schema = schema() order by table_schema, table_name, ordinal_position into outfile '/PATH/TO/OUTPUT.csv' fields terminated by ',';