ColdFusion: Configuring the MySQL JDBC driver (MySQL Connector)

All versions of ColdFusion include a MySQL JDBC driver. However, some users may choose to use more recent MySQL JDBC drivers distributed by MySQL in order to use newer features of MySQL.

This document describes how to configure ColdFusion to use a newer version of the driver.

Configuring ColdFusion to use a newer MySQL JDBC driver

  1. Download the desired version of MySQL Connector/J from the MySQL download site.
  2. Extract the JDBC driver JAR file.
    For example: mysql-connector-java-9.3.0-bin.jar.

  3. Place the JAR file in the ColdFusion Class Path:

    • Server Configuration: Place the mysql-connector-java-9.3.0-bin.jar in cfusion/lib
    • JEE Configuration: Place the mysql-connector-java-9.3.0-bin.jar in cfusion/lib
  4. Restart ColdFusion.

  5. Use the ColdFusion Administrator Data Sources page to add a new data source for the MySQL Connector. For more information, see Data Source management for ColdFusion.

    1. Name the data source MySQL_test when it will connect to the test database.

      Note: There is a test database installed by default in the MySQL server.
    2. Select Other in the driver field to tell ColdFusion you will describe another type of driver.
    3. Click Add to add the data source and display the default driver window for this driver.
  6. Enter the following in the JDBC URL field:

    jdbc:mysql://localhost:3306/test

    Where localhost is the name of the database server.
    Where 3306 is the port number for the data source connection.
    Where test is the database name.

    Note: The information in this field is case-sensitive.

  7. Enter the following in the Driver Class field:

    com.mysql.jdbc.Driver

    Note: The information in this field is case-sensitive.

  8. Enter a valid username and password in the Username and Password fields.

    Where the username and password are defined as user account information on the database server.

  9. (Optional) Enter the name of the driver in the Driver Name field.
  10. Click submit to apply the changes to the data source.

Get help faster and easier

New user?