Skip navigation
Currently Being Moderated

Can't verify MySQL DataSource

Nov 8, 2009 11:32 AM

Hi There,

 

I've got problem with setting up a new DataSource on MySQL 4/5 driver. From the beginning:

 

1. I've installed ColdFusion 9 (Developer Edition), with JRun 4 option. I've done configuration of Apache (conf file, and execution file)

2. When i want to set up new DataSource with MySQL 4/5 driver, i'm getting error.

 

For Example:

 

     CF Data Source Name:      MyDataSource

     Database:                         MyBase

     Server:                              localhost

     Port:                                 3306

     Username:                        user

     Password:                         password

 

After that. I have information:

Connection verification failed for data source: MyDataSource

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

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

 

 

 

The, in DataSource menu in Administration i see that base, but with this error under entry with name of DataSource.

What i'm doing wrong?

I have tried to install MangoBlog, but i can't do this with that issue. When i try, i get:

 

Could not find the ColdFusion component or interface CFIDE.scripts.MangoBlog_1.4.1.components.utilities.PreferencesFile.
            

 

I think it's about that error which i've described.

Anyone got some ideas to this ?

 

Greets,

Rafal

 
Replies
  • Jochem van Dieten
    2,391 posts
    Apr 8, 2001
    Currently Being Moderated
    Nov 8, 2009 11:45 AM   in reply to ronski87

    CF can not open a TCP socket to the database server. Check that the database server is actually running, listening on port 3306 and not locked by a firewall. If you have IPv6 enabled on your system, try 127.0.0.1 instead of localhost.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 9, 2009 3:07 PM   in reply to ronski87

    Are there any processes that might be claiming all the connections to the database?

     
    |
    Mark as:
  • Jochem van Dieten
    2,391 posts
    Apr 8, 2001
    Currently Being Moderated
    Nov 9, 2009 11:00 PM   in reply to BKBK

    A connection limit in MySQL that is exhausetd should give a different error since then you would essentially connect and be disconnected.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 10, 2009 12:05 PM   in reply to Jochem van Dieten
    @ Jochem van Dieten
    A connection limit in MySQL that is exhausetd should give a different error since then you would essentially connect and be disconnected.

    Why presume that, when you're told there were 3 attempts to reconnect?

     

    Ronski87, you can eliminate the connection-limit hypothesis by doing the following in the Administrator:

    1) For that particular datasource, choose to Show Advanced Settings. Enter this query in the field Validation Query:

    set @@global.max_connections = 1000;

    2) Press the button to submit the changes.

    3) Is the datasource now verified?

     

    If not, my next bet will be one of Jochem's ideas, a firewall block.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 10, 2009 1:31 PM   in reply to ronski87

    Hi,

    Maybe this KB or this KB will help you...

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 11, 2009 2:54 PM   in reply to ronski87
    all ports are blocked, excepts this few.

    You need security, but this is all-borders-closed dictatorship.

    You should configure the firewall to allow MySQL on port 3306.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2010 2:28 AM   in reply to ronski87

    I have the same problem as you. Can you explain what you mean by "set up new database in phpmyadmin (using MySQL". I am using Dreamweaver CS4.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 6, 2010 2:32 AM   in reply to ronski87

    You don't need to use PHPMyAdmin to do this.  PHPMyAdmin is just a web-based DB client.  MySQL does come with its own GUI management tools.  Or indeed one can just connect to the server on the command-line and do anything you like that way too ;-)

     

    My impression of PHPMyAdmin - although I've not used it for 7-8yrs - was that it was to a proper GUI tool what Outlook Web Access is to MS Outlook: a rather poor cousin.

     

    But - yes - to create a working CF DSN, there does have to be a database to connect to first, so one does need to create it if it doesn't already exist!

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 6, 2010 5:14 PM   in reply to Adam Cameron.

    I found the problem. Both IIS and PHP use port 80. I thought I had uninstalled IIS but had not.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 30, 2010 7:53 PM   in reply to ronski87

    Hi,

     

    I'm having exact same issue.

     

    Am able to connect via DW with PHP and everything works fine, then try connecting via CF9 Administration to the same database as PHP, I get same error message as above, then try connecting via DW with CF the error message is saying "access denied"

     

    Environment is;

    OS X 10.6.2 64 bit

    MAMP Pro 1.8.4

    CF 9 Developer Edition

    MySQL

     

    One thing I have notice is that CF 9 installer produced error log and when reviewing couldn't identify any issues and all seems to be working fine except connecting to MySQL.

     

    Can anyone assist?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 31, 2010 9:21 AM   in reply to gpferret

    You can try checking mySQL user settings in DB mysql TABLE user

     

    In field "host" of your user  CF requires to have "localhost". Some SQL shell (like the old gui tools of myMySQL) will set this field to "%".

     

    NB: setting to "localhost" you will no more able to access remotely with that user. You may want to duplicate the row.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 31, 2010 2:37 PM   in reply to Michele Gelli

    Many thanks for prompt response.

     

    Tried your suggest and unfortunately still the same issue, works with PHP but not CF.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 1, 2010 5:05 PM   in reply to gpferret

    Problem solved! 

     

    After some process of elimination, I worked out that MAMP Pro uses different install of mySQL to MAMP.....

     

    All I had to do is (In MAMP PRO, File -> Edit Template ->MySQL my.cnf) Find MAMP_skip-networking_MAMP and then remove or comment out this line) then restart all service.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 7, 2010 12:02 PM   in reply to gpferret

    I've got the exact same issue, but I didn't install mysql with MAMP Pro but through macports. I've verified the location of my socket and mysql is up and running fine, listening on port 3306 and seems to accept both TCP/IP connections as well as through the socket.

     

    I am on Mac OS Snow Leopard 10.6.3, running Coldfusion 9 and MySQL 5.1.47. The exact message I am getting when I try to verify the DSN from the Coldfusion Administrator is:

     

    Connection verification failed for  data source.
    com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:   Could not create connection to database server. Attempted reconnect 3  times. Giving up.
    The root cause was that:  com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:   Could not create connection to database server. Attempted reconnect 3  times. Giving up.

     

     

    Any insight into why I can't connect? All the online forums seem to suggest that it's the JDBC driver, but I am reluctant to replace the driver until I am absolutely sure that is the problem, since it might have other repurcussions.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 21, 2011 9:05 AM   in reply to brennaHS

    If you have MAMP PRO use port 8889 with colfusion

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2012 9:18 PM   in reply to gpferret

    gpferret, your solution totally fixed the problem I encountered. My data source verifies OK now. Thanks!

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 25, 2013 3:18 PM   in reply to timothyserrano

    Same problem with CF10, xampp-win32-1.8.1-VC9.  Problem was resolved by setting USER to "root".  It wouldn't let me use a custom user to whom I had granted all privileges.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points