I use MySQL 4.1 almost exclusively for my work, and was a little bummed
that neither CF 6.1 nor CF7 support the 3.x Connector J driver for
it. You can use the old driver, but you run into issues because
the authentication stuff changed between MySQL 4.0 and 4.1, and only
the new 3.x drivers support the new authentication. Macromedia's
got a technote
about setting up the new driver with CF, but that's still clunky,
because you have to use the "other" database type when setting up your
datasources. Very clunky and error prone. However, there's a
simple fix.
Inside the CF install there is a file named
'neo-query.xml'. Where exactly it is depends on what version of
CF you installed. In a J2EE install, it's in
/WEB-INF/cfusion/lib. Within that file is all your configured
datasources, as well as the base information for each database
type. A simple matter of changing the MySQL type's driver class
to be the one listed in the technote rather than the current value, and
you can again create MySQL datasources using the 'MySQL' datasource
type, and not have to mess with the 'other' type. All the other
settings can remain the same, though you may want to change the name of
the driver type as well (on CF7 it's "MySQL (3.x)").
Note, the
file is a big-ass one-line WDDX packet, so I'd highly recommend
a decent XML editor, rather than a text editor. I used XML Buddy
for Eclipse (one piece of my Eclipse toolkit); it's outline view makes
decyphering the WDDX enormously easier. There are also various
other neo-XXXXX.xml files in that same directory, all filled with other
settings and stuff that can be played around with. Just be
careful, but if you screw them up, your server might inexplicably stop
working untill you manually undo whatever you did.
I am still getting the same error, even after implementing your suggested change. Any ideas?
Nevermind…I got it. Thanx for the info.
Hey 's' – what did you do between 05:34 and 05:42 to resolve it – i still can't get this sucka working!
LL
woot – i _knew_ that if i posted a comment hewre i would resolve my issue within minutes and lo, that's precisely what happened.
it works!
thanks to all
LL
Hello, Are the J Connectors faster than the 3.5.1 ODBC connector I have installed? I'm looking for reasons why to upgrade to J Connectors.
Would it improve Selects and Inserts?
Walker,
I haven't done any testing, but if you're in a Java environment the Connector/J (JDBC) drivers should be preferred to ODBC drivers. They're portable (unlike ODBC), they're native Java (no context switches), and they come from MySQL AB.
OK I've edited my neo-query.xml file so that the MySQL driver class is using com.mysql.jdbc.Driver and restarted CF
However…
When I add a new MySQL datasource using MySQL as the type it still uses the old driver class as org.gjt.mm.mysql.Driver
It seems that new MySQL datasources added after editing the xml file are being ignored and just using the default. Am I missing something else?
Phil,
Any particular reason you're still developing new apps on CF6/7? CF8 ships with the Connector/J drivers, so no need to futz around with it on that version.
Yep it's a legacy thing really as most of my clients are still running on CF7…
Phil,
Did you check the neo-query.xml file and see if it still references Connector/J? I seem to recall that CF writes those files on exit, so if you changed it while CF was running (and then restarted after saving), it's possible that it got reverted. That's just a faint glimmer on the edge of my consciousness though, and I don't have CF7 anywhere to test.