mysqldump2csv

command module
v0.0.0-...-f529131 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

README

mysqldump2csv Build Status Coverage Report card GoDoc

by Andrew Brampton (bramp.net)

Convert a MySQL SQL dumps to a CSV file. Originally developed to convert Wikipedia database backups into something more parsable. Uses a SQL parser to correctly parse the file, instead of hacky regexes (or likewise) that are unreliable.

Install

go install bramp.net/mysqldump2csv

Usage

mysqldump2csv - Convert MySQL SQL Dumps to CSV

Usage:
  mysqldump2csv [flags] <dump.sql>

Flags:
  -delimiter string         field delimiter (default: ",")
  -newline string           line terminator (default: "\n")

  -header                   Print the CSV header (default: true)
  -multi                    A CSV file is created for each table (default: false)
  -table string             Filter the input to only this table (default: "")
  -verbose                  Verbose output (default: false)

Example:

$ mysqldump2csv enwiki-20170901-page.sql.gz > enwiki-20170901-page.csv

After writing this I found an almost identical application, mysqldump-to-csv written with the same goals.

Licence (Apache 2)

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.

Copyright 2017 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Documentation

Overview

mysqldump2csv takes a MySQL dump, and extracts the fields echoing them as a CSV.

by Andrew Brampton (https://bramp.net)

See https://bramp.net/mysqldump2csv for instructions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL