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.
Shell script to convert Access DB to SQL - Requires mdbtools
#!/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
@0x70b1a5
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment