Migrating the MS Access "Parts" Database to MySQL
This procedure details how to generate table creation scripts, execute DDL and configure server settings in MySQL Workbench, export data using pipe-delimited text files, configure the Access frontend connection string, and stream data via high-speed bulk loading.
Step 1: Generate MySQL Table Creation Scripts
- In the Parts Frontend, open the Tools menu[cite: 6].
- Click MySQL Scripts[cite: 6].
- Select your target output folder and click OK.
- The utility scans the Access backend tables and outputs individual MySQL 8.0 DDL script files (`.sql`) for each table[cite: 7, 8]:
- MySQL table script for mfr_links.sql[cite: 7, 8]
- MySQL table script for parts.sql[cite: 7, 8, 11]
- MySQL table script for supplier_links.sql[cite: 7, 8]
Step 2: Execute DDL Scripts & Enable Local Infile in MySQL Workbench
- Open MySQL Workbench and log into your AWS RDS MySQL instance.
- Select File > Open SQL Script from the main toolbar and browse to open each generated `.sql` file (`mfr_links.sql`, `parts.sql`, `supplier_links.sql`)[cite: 7, 8, 11].
- Click the lightning bolt icon (⚡ Execute the selected portion of the script or everything) on the query editor toolbar to execute the DDL statements and create the `parts` schema and tables on AWS RDS[cite: 11].
- Verify and enable loading data from local CSV files:
- Run the following query to check the current setting:
SHOW VARIABLES LIKE "local_infile";
- If the value returns OFF, execute:
SET GLOBAL local_infile = 1;
- Run the following query to check the current setting:
Step 3: Export Data to Pipe-Delimited CSV Files
- In the MS Access Tools dialog, click Export CSV[cite: 12].
- Select your working export folder when prompted.
- The macro exports each table into a pipe-delimited (`|`), quote-qualified (`"`) text file[cite: 13]. This formatting prevents commas inside component values, descriptions, or parameters from disrupting column boundaries during import[cite: 13].
Step 4: Configure Access Frontend MySQL Connection String
- In the Parts Frontend, navigate to Configuration.
- In the Select a Parts Database, i.e. Access *.accdb file. Or enter a MySQL ODBC Connection String input field, enter your DSN-less MySQL ODBC connection string:
ODBC;DRIVER={MySQL ODBC 8.4 UNICODE Driver};SERVER=parts-db-instance.c123456789.us-west-2.rds.amazonaws.com;PORT=3306;DATABASE=parts;USER=username;PWD=YourPassword;OPTION=3;
- Click Apply Configuration. The frontend will re-link TableDefs and connect directly to the remote MySQL backend tables.
Step 5: Execute Bulk Data Import into MySQL
- In the MS Access Tools dialog, click MySQL Load Data (or Import Excel)[cite: 6, 12].
- Select the folder containing the exported pipe-delimited files when prompted[cite: 13].
- The macro streams the records into the remote MySQL tables using high-speed bulk transfer.
- Verify row counts in MySQL Workbench:
SELECT COUNT(*) FROM parts.parts;
No comments:
Post a Comment