Access To MySQL Documentation
This documentation is a changing document. Most of the program is self explaining and need no further documentation. Play with it and find out what it can do.
- Running the Program
- Command Line Interface
- Tips and Tricks
- Frequently Asked Questions
Before you are able to run the program you need the following installed on your system:
- Microsoft Windows operating system
- Microsoft Access
- MySQL ODBC driver
Note: If you use MySQL Server 4.1 or later you must have the ODBC version 3.51.10 or later.
The installation is very simple. Just download the setup program and run it. A wizard will guide you through the installation.
When you start the program it will display a wizard designed to guide you through the conversion of your Access database to a MySQL database.
Select the Access database that you want to convert.
After selecting a source database you must specify the destination. The destination is a MySQL server or a dump file. If you select the destination to be a dump file you must specify a file name of the dump file.
In case you want to transfer the source data directly to a MySQL server you must enter the connection settings for the server. It is important that the specified username and password are valid. Make sure that the specified user is allowed to connect to the server from the computer where the conversion is run.
Since the introduction of MySQL 4.1 it is required that you connect to a specific database when you use ODBC. Hence, you must specify a database in the connection settings. This database does not serve any other purpose that connecting to the server. The connection database will not be modified during the transfer of data unless you have specified the same database as the destination database. If you connect to a MySQL server prior to 4.1 you can leave this field blank.
The specified database name, which receives the data, is also entered here.
At this step of the conversion wizard all the source tables are listed. Select the tables that you want to transfer.
A set of transfer options will decide how the source database is converted to MySQL. These options are listed below.
Drop and recreate destination database - If the option is checked the destination database specified on the "Destination Database" step of the wizard will be dropped and recreated during the transfer. Please note that all information in the existing database is lost when using this option.
Transfer indexes - This option will control the creation of indexes on the new tables in the destination database. Check this option to transfer indexes for all tables.
Transfer records - If you leave this option unchecked you only transfer the table definitions and not the actual data. Check this option to include the data in the transfer.
Default value properties - Some table fields may have a default value when a new record is created. Check this option if you want to transfer the definitions of default values to the destination table.
Auto number properties - In access you can define fields of type "Autonumber". This property of the field can be transferred to the destination database.
After conversion the wizard will show you the result of the conversion. In case of an error during the conversion that error would be listed in the result.
All the settings of the wizard can be saved in case you want to run the wizard with the same settings again at a later time. Save settings can also be used to run the conversion from a command line at a later time. Please note that passwords are stored in clear text within the configuration file.
Another powerful feature of this program is the command line interface. It enables you to run the conversion without any user interaction.
It is possible to specify a settings file from the command line.
msa2mys [SETTINGS="mysettings.ini"] [, AUTORUN] [, HIDE] [, CLEARLOG]
AUTORUN - Run without interaction.
CLEARLOG - Clear the log file. If this parameter is omitted the log file will continue to grow.
HIDE - Disables messages in case of an error. Errors are logged to the log file.
SETTINGS - Specifies a saved configuration file.
When you run the wizard it will remember your selections until you run it the next time. Passwords are not remembered because of security reasons. However, if you want the program to remember the passwords you can change the following registry entry:
HKEY_CURRENT_USER\Software\VB and VBA Program Settings\MS Access to MySQL\Settings\SavePasswords
Set the value to 1 in order to store passwords and change it to 0 if you want to disable this feature. Please note that passwords are stored in clear text within the configuration file.
Q: Why do I get a 'Catastrophic Failure' when connecting to the destination database?
A: The most common reason for this error is that you are using MySQL Server 4.1 or later with Access to MySQL version 220.127.116.11 or earlier. You must upgrade to Access to MySQL version 18.104.22.168 or later. If you have this version you can still get this error if you do not specify a connection database when entering the connection options.
Q: Why do I get an error about the 'authentication protocol' when connecting to the destination database?
A: Most likely because you use an older MySQL ODBC driver. You driver must have version 22.214.171.124 or later.