Accessibility

TechNote

ColdFusion MX: Configuring the MySQL JDBC driver (MySQL Connector)

All versions of Macromedia ColdFusion MX include a MySQL JDBC Type 4 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 TechNote describes how to configure ColdFusion MX to use a newer version of the driver.

Configuring ColdFusionMX 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-3.1.10-bin.jar.
  3. Place the JAR file in the ColdFusion Class Path:
    • Server Configuration: Place the mysql-connector-java-3.1.10-bin.jar incf_root/wwwroot/WEB-INF/lib
    • J2EE Configuration: Place the mysql-connector-java-3.1.10-bin.jar incf_web_root/WEB-INF/lib
  4. Restart ColdFusion MX.
  5. Use the ColdFusion MX Administrator Data Sources page to add a new data source for the MySQL Connector:

    For example:
    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.

Additional Information


Connector/J version 3.1 release 3.1.11 or 3.1.12 cannot be used with ColdFusion MX 7 because of mySQL Bug 13469. Connector/J 3.1.13 fixes this bug, so driver version 3.1.10 or 3.1.13 should be used. All Connector/J version 3.0 releases and all (currently beta) version 3.2 releases work with ColdFusion MX 7.

Related TechNotes

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_19170
OS:HP-UX
Linux
Mac OS (All)
Solaris
UNIX
Windows (All)
AIX
Browser:Chrome
Internet Explorer
Netscape
Opera
Safari
Firefox
Database:MySQL

Products Affected:

coldfusion