Skip to content

Instantly share code, notes, and snippets.

@togume
Created November 5, 2017 02:56
Show Gist options
  • Save togume/83b4bf40e1528742374bbce338270f34 to your computer and use it in GitHub Desktop.
Save togume/83b4bf40e1528742374bbce338270f34 to your computer and use it in GitHub Desktop.

Revisions

  1. togume created this gist Nov 5, 2017.
    13 changes: 13 additions & 0 deletions access_to_mysql.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/bin/bash
    TABLES=$(mdb-tables -1 $1)

    for t in $TABLES
    do
    echo "DROP TABLE IF EXISTS $t;"
    done

    mdb-schema $1 mysql
    for t in $TABLES
    do
    mdb-export -D '%Y-%m-%d %H:%M:%S' -I mysql $1 $t
    done