Skip to content

Instantly share code, notes, and snippets.

@meyt
Last active May 6, 2023 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meyt/c9fad6f820238df53a7e4d96f585f057 to your computer and use it in GitHub Desktop.
Save meyt/c9fad6f820238df53a7e4d96f585f057 to your computer and use it in GitHub Desktop.
Export MS Access database (accdb, accde) in linux+mdbtools
#!/bin/bash
# tested with mdbtools@0.9.1-1 on Debian@11
#
# Setup:
# sudo apt install mdbtools -y
#
# Usage:
# bash ./acc2sql.sh mydb.accdb mydb.sql
##
mdb=$1
sql=$2
backend='postgres'
for table in $(mdb-tables $mdb); do
echo $table $mdb
mdb-export -I $backend $mdb $table >> $sql
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment