What is the best way to synchronize data between MS Access and MySQL?

前端 未结 5 1367
面向向阳花
面向向阳花 2020-12-03 23:18

I have an access database on a windows machine, which I must import into mysql on a linux webserver. At the moment the access dabatbase table is exported as a text file, aut

5条回答
  •  醉酒成梦
    2020-12-03 23:48

    I would do the following:

    Dump all your Access data into a temp table in MySQL, which will be your "master" source of data for a moment. You should be able to do this by setting up an ODBC data source pointed at MySQL, right-clicking on the Access table, and hitting "Export".

    1. Run an UPDATE script in MySql to update matching records
    2. Run an INSERT script in MySql to insert new records
    3. (Optional, depending on whether this is what you want): Run a DELETE script in MySql to delete records that AREN'T found in the newly imported Access table.
    4. Drop the temp table in MySql.

    It is possible to do all of this from inside MS Access, via linked tables. But the performance won't be as good, and it will require changing the Access statements when/if your MySql tables change.

    This answer may be helpful to you, too.

提交回复
热议问题