views:

96

answers:

3

I've recently set up a Ubuntu 9.10 server with a LAMP configuration and then installed Coldfusion 9 Development version as well.

I've got phpMyAdmin working, so MySql and PHP are fine, and I can serve coldfusion pages, but if I cannot verify my Coldfusion datasource. I get the following error:

Could not create connection to database server. Attempted reconnect 3 times. Giving up.

With the top of the stack trace showing

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

These are my settings for the datasource in the Coldfusion administrator

JDBC URL jdbc:mysql://192.168.1.19:3306/dbname

Drive class com.mysql.jdbc.Driver

Driver name ConnectorJ 5.1.7

And I know the username and password are correct as they're the same ones I use for phpMyAdmin. Does anyone have any ideas why it's not working?

+1  A: 

I'm using almost the same configuration on few boxes and have no such problems, so it looks like you are misconfiguring the datasource.

Are you trying to create the dsn with "MySQL (4/5)" driver? I'm not sure how to read your settings string properly. Is that IP is your localhost? If yes, why not try to use the localhost for server name.

Sergii
I've tried using the local IP and local host and it makes no difference. I'm trying to use the JDBC driver as that's how I've got it set up on an older Coldfusion 7 server, but with an older JDBC driver.I've tried with the Mysql 4/5 driver and that doesn't help either.And sorry I hadn't realised I'd lost the line breaks in the settings, I've reformated that now.
Comcar
A: 

Try using 127.0.0.1 as the MySQL server address in your DSN configuration

Cody Caughlan
Tried that, and local host as well as the IP, no difference
Comcar
+1  A: 

It's a permissions problem. The IP needed to be 192.168.1.19 in the DSN setup in the administrator, but that didn't fix it alone.

I also created a 'temp' MySQL user based on a post found here: http://www.linuxquestions.org/questions/showthread.php?p=4039359#post4039359

And used that instead, it worked.

Comcar