bpurcell.org - Configuring the third party MySQL database driver in ColdFusion MX
Calendar
SunMonTueWedThuFriSat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Subject Archives
Amazon EC2 (15)
ColdFusionMX (155)
Corvette (3)
Flash Lite (4)
Flash Media Server (5)
Flash Player (3)
Flex (39)
General Web Dev (14)
HDTV (3)
Jboss (1)
Jquery (2)
JRun (59)
Max 2003 (3)
Other (33)
PC Hardware (16)
Software (17)
SpatialKey (7)
Wireless (8)
Working Out (1)

RSS Feed
Feed Listing

Site Contents
Home
My Blog
ColdFusion
JRun
Flex
Wireless & Networking
Hardware & Gadgets
HDTV
Software Picks
Pictures
Contact Me
Search


My Articles & Papers
Flex Performance
Server/Client
mm.com Under the Hood
Multiple Instances of CFMX
Multiple Instance Config
NLB with ColdFusion
Clustering CFMX for J2EE
Multi-Tier Hardware LB w CFMX
Cisco CSS & Coldfusion MX
JRun 4 Jini based Clustering
WiFi Growth

2ID Tacweb

Other Hobbys
Body-For-Life Challenge

Personal Projects
Family Pool
Deck Gate

username:
password:
 

 
Viewing Individual Entry / Main
November 26, 2003

In some cases you may run into an issue with the packaged MySQL driver that comes packaged with ColdFusion. You have the option of configuring a third party driver or the latest driver from the mysql website. The MySQLwebsite contains several different drivers that you can use in different cases. For ColdFusionMX you are best off using the latest production ready JDBC driver (MySQL Connector/J). The driver is available for download at http://www.mysql.com/downloads/api-jdbc-stable.html

Steps for configuring the mySQL driver:

  1. Go to the download page and scroll down until you get the Source and Binaries section. Click on Download for either the .zip (windows) or tar.gz (unix).
  2. Extract the file with winzip (windows) or gzip then tar on unix
  3. After extraction you will see the file mysql-connector-java-3.0.9-stable-bin.jar place the file in the the JRun4/servers/lib or CFusionMX/servers/lib directory. (depending on how you installed CF). In some cases if you installed standalone you will not have a CFusionMX/servers/lib directory, if you do not go ahead and create it.
  4. Restart CF
  5. Open up the ColdFusion Administrator and click on Data Sources
  6. Enter a Datasource name and choose "other" in the dropdown menu for the driver
  7. Enter the following information for the driver details
    JDBC URL: jdbc:mysql://servername:port/dbname (I used jdbc:mysql://ps-gamay:3306/scott)
    Driver Class: com.mysql.jdbc.Driver
    Driver Name: com.mysql.jdbc.Driver
    Username: dbusername
    Password: dbpassword
  8. Click Submit and the datasource should verify correctly if you have all the parameters correct

Comments

Brandon -

You might want to include a link to the supported JVMs (see below). Is it true that the current version supports anything from 1.2 to 1.4, and doesn't require a specific version? I ask cuz I've had a devil of a time getting an Oracle jdbc driver to work on MX. I keep trying different versions, and each seems to only support a particular version of JRE (so I have to go reinstall that). Anyway, here's the link.

http://www.mysql.com/documentation/connector-j/index.html#id2800741


Hi all, I thought I would post this hear, because I just so happened to get to hear through a google search trying to reasearch a problem. Our company uses coldfusion + some custom java I wrote + mysql to connect to our backend system SAP. As it so happens there seemed to be a bug in the mysql drivers ColdFusion MX 6.1 was using. I was getting a before result set error, when the object was called from coldfusion, but not when i ran it from my test program command line. I viewed the macromedia_drivers.jar file and found they where using drivers that where over a year old. I took that jar file extracted it, removed the org top level directory, being that it only help mysql drivers, and re-jarred it. then i put it back to /pathto/coldufionmx/lib directory along with mysql-stable.jar file and restarted the server and all seems to be working fine! If you can believe it. If anyone has some other suggestions, i would be interested in hearing htem.


Brandon, would there be any logic in the fact that the jdbc driver appears to be much slower than using the mysql 3.x driver already included in coldfusion? On running the same queries side by side on the same page each with a different driver, off a mysql 5 database (have to use the old_password setting to make the 3.x one work), the mysql one appears to be 10x faster. It's hard to believe this is true, especially as I can't find any mention of it elsewhere, but it made a huge difference on a site I just launched and on local testing it is holding true! Note that this is a 3.1.13 connector, so perhaps it is just that version, but even then it's strange that no one else has mentioned this?


Hi Brandon, I figured I would reference this technote here as it has some updated info.

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19170

Thanks, Brett


Brett, do you have any further feedback on whether it might be a coldfusion bug or a jdbc driver bug that is causing slowdowns when using the driver as explained in that technote? When using the default mysql 3.x driver that comes with cfmx (using the old_password setting), we managed to speed up our site greatly. For another site I did (norwegian only) it made about 3 seconds difference per query and traffic on that site is tiny. On a bigger site (primarily english +- 5 million pgvws a mnth) it still made a big difference at around a second a query on most of the slower queries, with improvements across the board for all queries. In any case, if anyone else is finding cfm on mysql unnecessarily slow, try different driver solutions.


Just to let you know I've installed the 5.0.4 version of the MySQL connectorJ drivers and performance with them appears very promising.

http://www.lynchconsulting.com.au/blog/index.cfm/2007/2/21/Trouble-shooting-slow-queries-on-MySQL-5-with-CFMX--Solved

Anyone else had success or failures with the 5.0.x series of drivers and CFMX?


Thanks for your helpful information.

I have downloaded MySQL-connector-java-3.0.17-ga. Put into my ColdFusionMX7 lib directory and restarted server. However, I got into some problems.

After I login to my Local CFMX7 administrator...Enter a Datasource name and choose "other" in the dropdown menu for the driver. After then I see the forms as you discribed. servername? I don't know my servername :( Username? I dont know??? Password? Can I put my CF administrator password?

Can I use same as you did? jdbc:mysql://ps-gamay:3306/scott


 
Page Render Time:16