Nice programing

MDB (액세스) 파일을 MySQL (또는 일반 SQL 파일)로 어떻게 변환 할 수 있습니까?

nicepro 2020. 10. 28. 20:59
반응형

MDB (액세스) 파일을 MySQL (또는 일반 SQL 파일)로 어떻게 변환 할 수 있습니까?


Microsoft Access 데이터베이스에서 SQL 명령 덤프를 만들 수 있습니까? 이 MDB 파일을 가져 오기를 위해 MySQL 데이터베이스로 변환하여 CSV 단계를 거칠 필요가 없도록하고 싶습니다.

MSSQL 덤프 파일에도 여전히 실행 가능한 SQL 명령이 포함되어있을 것으로 예상하지만 MSSQL에 대해 아는 것이 없습니다. 알려주십시오.


mdb를 mysql로 ​​변환하고 싶습니까 (mysql 또는 mysql 덤프로 직접 전송)?

Access to MySQL 이라는 소프트웨어를 사용해보십시오 .

MySQL 에 대한 액세스는 Microsoft Access 데이터베이스를 MySQL로 변환하는 작은 프로그램입니다.

  • 마법사 인터페이스.
  • 한 서버에서 다른 서버로 직접 데이터를 전송합니다.
  • 덤프 파일을 만듭니다.
  • 전송할 테이블을 선택하십시오.
  • 전송할 필드를 선택하십시오.
  • 암호로 보호 된 데이터베이스를 전송합니다.
  • 공유 보안 및 사용자 수준 보안을 모두 지원합니다.
  • 색인의 선택적 전송.
  • 기록의 선택적 전송.
  • 필드 정의에서 기본값의 선택적 전송.
  • 자동 번호 필드 유형을 식별하고 전송합니다.
  • 명령 줄 인터페이스.
  • 간편한 설치, 제거 및 업그레이드.

스크린 샷이있는 단계별 자습서는 앞서 언급 한 링크를 참조하십시오.


mdbtools가 설치된 Linux 상자에 액세스 할 수있는 경우 다음 Bash 셸 스크립트를 사용할 수 있습니다 (mdbconvert.sh로 저장).

#!/bin/bash

TABLES=$(mdb-tables -1 $1)

MUSER="root"
MPASS="yourpassword"
MDB="$2"

MYSQL=$(which mysql)

for t in $TABLES
do
    $MYSQL -u $MUSER -p$MPASS $MDB -e "DROP TABLE IF EXISTS $t"
done

mdb-schema $1 mysql | $MYSQL -u $MUSER -p$MPASS $MDB

for t in $TABLES
do
    mdb-export -D '%Y-%m-%d %H:%M:%S' -I mysql $1 $t | $MYSQL -u $MUSER -p$MPASS $MDB
done

호출하려면 다음과 같이 호출하면됩니다.

./mdbconvert.sh accessfile.mdb mysqldatabasename

모든 테이블과 모든 데이터를 가져옵니다.


데이터베이스를 stdout (일반적인 유닉스 스크립트 방식)으로 출력하도록 Nicolay77의 스크립트를 수정하여 데이터를 텍스트 파일로 출력하거나 원하는 프로그램으로 파이프 할 수있었습니다. 결과 스크립트는 조금 더 간단하고 잘 작동합니다.

몇 가지 예 :

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

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

다음은 수정 된 스크립트입니다 (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

Free database tools don't export table RELATIONSHIPS, but you can use this: converting MS Access to MySQL with relationships

Works fine and export all relationships to MySQL.

enter image description here


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.


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)


Try the Data Transformation Services of microsoft


We've used ESF Database Convert many times for this exact purpose. DTS was usually too flakey. And the recommendations on the MySQL page were woefully out of date.


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


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.

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.


If you are not too concerned with the privacy of the .mdb files you want to convert, please know that this site allowed me to recover two 15-years-old .mdb Access databases (remember the old times when ASP ruled the web?) in just two minutes : http://www.mdbopener.com/

The databases were converted in Excel files, with one sheet for each table. Just what I needed. Couldn't have been any faster to recover my (very) old data...

The IDs being kept in each table, it was as easy as anything to convert this again to mysql (after saving it to CSV format) - again, in just a few minutes.


I tried https://www.rebasedata.com/convert-mdb-to-mysql-online and it works pretty well.

Online solution without the need for registration.

참고URL : https://stackoverflow.com/questions/5722544/how-can-i-convert-an-mdb-access-file-to-mysql-or-plain-sql-file

반응형