How can I convert an MDB (Access) file to MySQL (o

2019-01-29 17:30发布

Is it possible to create a Dump of SQL commands from a Microsoft Access database? I hope to convert this MDB file into a MySQL database for importing so I don't have to go through the CSV step.

I would expect even an MSSQL dump file to still contain workable SQL commands, but I know nothing of MSSQL, please let me know.

12条回答
欢心
2楼-- · 2019-01-29 18:10

Try the Data Wizard for MySQL. It is a tool for converting structure and data from any ADO-compatible source (e.g. MS Access) to MySQL databases. See a brief guide to connection strings to build connection string to your MS Access file.

查看更多
混吃等死
3楼-- · 2019-01-29 18:13

I use a Mac I do this to convert;

  1. Download ACCDB MDB Explorer http://accdb-mdb-explorer.en.softonic.com/mac
  2. Open the MDB file
  3. Export as SQL
  4. Import in MySQL using MySQL Workbench.
查看更多
对你真心纯属浪费
4楼-- · 2019-01-29 18:15

I modified the script by Nicolay77 to output the database to stdout (the usual way of unix scripts) so that I could output the data to text file or pipe it to any program I want. The resulting script is a bit simpler and works well.

Some examples:

./to_mysql.sh database.mdb > data.sql

./to_mysql.sh database.mdb | mysql destination-db -u user -p

Here is the modified script (save to to_mysql.sh)

#!/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
查看更多
在下西门庆
5楼-- · 2019-01-29 18:15

This mac tool MDB / ACCDB Viewer worked well for my needs. Free trial let me prove everything did the required, and exported half of all rows. Full version was required to get the whole db/tables exported.

查看更多
一纸荒年 Trace。
6楼-- · 2019-01-29 18:16

OSX users can follow by Nicolay77 or mikkom that uses the mdbtools utility. You can install it via Homebrew. Just have your homebrew installed and then go

$ homebrew install mdbtools

Then create one of the scripts described by the guys and use it. I've used mikkom's one, converted all my mdb files into sql.

$ ./to_mysql.sh myfile.mdb > myfile.sql

(which btw contains more than 1 table)

查看更多
疯言疯语
7楼-- · 2019-01-29 18:16

I've used SQLYog Ultimate to import data from mdb file, it was very easy process.

you may need to install these support tool.

MS Access Database engine

and download SQLYog Ultimate below

Pick SQLYog, you can use trial version for this

查看更多
登录 后发表回答