Created
June 7, 2016 04:54
-
-
Save lentschi/c960e9d23cc17019373bc2b9eb0e8141 to your computer and use it in GitHub Desktop.
Dumps schema and data of a Microsoft Access database file to mysql (REQUIRES mdbtools!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Dumps schema and data of mdbfile (which can be .accdb too) to mysql | |
if [ $# -ne 2 ]; then | |
echo usage: $0 mdbfile mysqlfile | |
exit 1 | |
fi | |
mdb-schema $1 mysql > $2 | |
for i in $( mdb-tables $1 ) | |
do | |
mdb-export -D "%Y-%m-%d %H:%M:%S" -H -I mysql $1 $i >> $2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment