• Sponsored Links :

Simple, Strongly Controlled Migration from MS Access to MySQL

While on the fag end of a project for the MIT course, for which I had used MySQL throughout while the rest of the participants had preferred Oracle 9i, MS Access and even 10g (what's with the browser driven control?) I finally sought and found an easy way to migrate all my tables from Access to MySQL. More on the 9i2MySQL migration later, but here are the steps for the Access2MySQL migration:

1. Export the data from Access to a .csv file [mytable.csv]
2. Place this file, say, in D:\
3. Fire up mysql query browser (or get it and then fire it up :)
4. Create the table [mytable] in the appropriate database (more on this step later)
5. Run the following query
LOAD DATA LOCAL INFILE 'D:\\[mytable.csv]'
INTO TABLE [mytable]
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\r\n';
6. You are done

The main advantage of using your own DDL (Step 4) is that it allows you good control over the relationships and data types. There are many data type differences between Access and MySQL (date, memo, etc). Although this means having to convert all the date entries by hand (for now, let's try to find a work around for that) it keeps the data type conversions in user's hands.

This is my first post, so all corrections and comments are welcome :)

The reasons for such a migration may be found at:
http://dev.mysql.com/tech-resources/articles/migrating-from-microsoft.html

shuklan's picture