Connecting to MySQL
Prerequisite Software
In order to connect to a MySQL server you will need the MySQL Client and ODBC Driver installed on your machine. These components are packaged together as the MySQL Connector (they had previously been called MyODBC). MySQL Connector can be downloaded from the MySQL site www.mysql.org/
There are a number of third-party ODBC Drivers, such as Devart (https://www.devart.com/odbc/mysql/). We haven't used this ODBC Driver so cannot comment on its capabilities.
Configuring the Connection to your MySQL Server
Once MySQL Connector has been installed, you need to configure an ODBC Datasource for your database. The general process for doing this is described in Configuring a Database Connection.
To configure this, specify:
- Data Source Name. The name you give this ODBC datasource.
- Description. Not used. Leave blank.
- Host/Server Name. The hostname or IP address of the machine on which the MySQL server resides. Specify localhost if the server is on your own PC.
- Database Name. The MySQL database (on the MySQL server) you wish to connect to. If this is left blank, you will connect to database mysql. If you do not have access to this database, your connection will fail.
- User/Password. Not used. Leave blank.
- Port. The TCP/IP port the MySQL server is listening on. In most cases the default (3306) is the correct value. If in doubt, contact the person who has configured the MySQL server.
- SQL command on connect. Not used. Leave blank.
It is recommended that you click on Test Data Source to test that your connection has been configured correctly.