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:
- 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).
- Extract the file with winzip (windows) or gzip then tar on unix
- 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.
- Restart CF
- Open up the ColdFusion Administrator and click on Data Sources
- Enter a Datasource name and choose "other" in the dropdown menu for the driver
- 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
- 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
Posted by Steve Ray at 11/26/03 3:32 PM
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.
Posted by j at 12/3/03 7:35 AM
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?
Posted by Sam at 10/24/06 6:10 AM
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
Posted by Brett Cortese at 11/9/06 2:20 PM
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.
Posted by Sam at 11/12/06 5:56 AM
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?
Posted by Mark Lynch at 2/21/07 12:40 AM
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
Posted by Adam at 3/11/07 4:18 AM
|