Skip to main content
Participant
Nov 8, 2009 7:30 PM UTC
Question

Can't verify MySQL DataSource

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

This topic is closed to new replies. Start a new post to keep the conversation going.

24 replies

Inspiring
Jul 18, 2016 12:05 AM UTC

Another cause:

I migrated the datasources for a CF9 install to a new computer by copying the lib/neo-datasource.xml file. Restarted all CF services. All good, datasources appear in cfadmin. But... the passwords for the MySql server were wrong even though the MySql db password was the same as on the old server). I guess they are not stored in neo-datasource.xml which makes sense.

Anyway, I just went through and re-entered the password for each datasource and it verified ok each time.

FYI

Murray

Translate
Participant
Jul 26, 2018 4:42 PM UTC

I have been trying to get ColdFusion 9.x to connect to an installed MySQL 8 server (Also running MS SQL and IIS) and getting the same error.  The solution turned out to be to open the advanced section of the Data Source Name form and enter the following string into the "Connection String" box:

useUnicode=yes&characterEncoding=UTF-8

Hope that helps someone.

Translate
Participant
Sep 23, 2014 2:02 PM UTC

I had the same problem with CF 11 and CF 10 on Mac, running Mysql with MAMP Pro. What I did in the end was a combination of these steps, I don't know if all are necessary but at least it works now

1. In MAMP pro go to -> file > edit template > MYSQL my.cnf (after you shut down the server)

2. Comment out MAMP_skip-networking_MAMP

3. Added: max_connections = 1000 (in section [mysqld])

4. Restart server in MAMP

5. In CF datasource I changed server settings to 127.0.0.1 port 3306

Translate
Participant
Mar 31, 2010 2:53 AM UTC

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?

Translate
Mar 31, 2010 4:21 PM UTC

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.

Translate
Participant
Mar 31, 2010 9:37 PM UTC

Many thanks for prompt response.

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

Translate
ronuśAuthor
Participant
Dec 13, 2009 4:29 PM UTC

Hi there again.

sorry guys (and girls if any ofc), i'm so stupid...

the only problem with my issue was that, i didn't set up new database in phpmyadmin (using MySQL). Now, i set new one, set user, password and... everything works fine.

sorry for that, human is learning for all the time

I want to thank everybody who helps me with posting, and see You again in the next issue

Greetings,

Rafał

Translate
Feb 3, 2010 10:28 AM UTC

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.

Translate
ronuśAuthor
Participant
Feb 6, 2010 10:00 AM UTC

Hi, if You want to use DataSource with MySQL driver, you have to SET UP a new database via phpMyAdmin. It is a tool which with you can add and make everything you want with MySQL databases. Setting it up, adding new tables, edit tables and more. I'm using WAMPP (Apache, MySQL, PHP) - a windows web development environment. here yoe've got the link:

http://www.wampserver.com/en/download.php

If You have more questions, write here or send me pm.

Translate
ronuśAuthor
Participant
Nov 11, 2009 1:55 PM UTC

Thanks for all reply's

I've tried to make with your suggestions, that means with Your suggestion BKBK -> still the same error.

Alexei -> this .jar's neither.

I downloaded Advanced Port scanner to test port's status. Every time (is firewall on or not) i have 3 to 5 ports opened (23 - telnet, 25 - smtp, 80 - www, 110 - pop3). Rest is blocked. I work on laptop, but situation with my standalone PC looks the same -> all ports are blocked, excepts this few.

Translate
BKBK
Community Expert
Community Expert
Nov 11, 2009 10:54 PM UTC
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.

Translate
BKBK
Community Expert
Community Expert
Nov 9, 2009 11:07 PM UTC

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

Translate
Inspiring
Nov 10, 2009 7:00 AM UTC

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

Translate
BKBK
Community Expert
Community Expert
Nov 10, 2009 8:05 PM UTC
@ 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.

Translate
Inspiring
Nov 8, 2009 7:45 PM UTC

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.

Translate