开发者

ColdFusion datasource doesn't connect properly

开发者 https://www.devze.com 2023-03-08 00:18 出处:网络
I\'m trying to create a datasource to connect to a MySQL database. When I put in all my info I get this error:

I'm trying to create a datasource to connect to a MySQL database. When I put in all my info I get this error:

Connection verification failed for data source: phoenix3 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.

I can't seem to fix it. Any suggestions?


Check your settings in mySql for max connections.

http://forums.mysql.com/read.php?39,181940,226710#msg-226710

Possibly MySql is blocking your CFserver for some reason, possibly too many login failures by your cf user? if so try flushing your hosts.

http://www.oscararevalo.com/index.cfm/2010/10/28/Getting-MySQLNonTransientConnectionException-errors-Then-Your-MySQL-Server-Might-Be-Angry-At-You


You probably just changed the password, or the table privileges have been altered.

I have a mixed server running ColdFusion 9, PHP 5, and Ruby 1.9.2. I set up CF9 and MySQL and they were happy together. I named the CF user 'wwwrun' (legacy from a previous CFMX install of the same app). Later, I was setting up the PHP portion of my heterogeneous application and did a GRANT statement for a set of WordPress tables for the same user ('wwwrun')...but made the mistake of assigning a different password. The WordPress portion worked fine, but all of sudden my CF stuff was throwing this error.

Doh!

I had changed the password for the 'wwwrun' user. You may have inadvertently done the same. This is the error the JDBC driver gives when it fails password authentication. Not a very informative error message IMO.


A better error message can be seen by looking at your ColdFusion exceptions.log when this happens.

I recently encountered a scenario where I got this message and by looking at the exceptions.log file I could see a message like:

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'my_db_name'


I got similar this and I found that the root cause is the mysql user that used in connection setup have not permission on that database.

Update permission for mysql user fixed my issue.


I had the same problem connecting to MySQL(installed via MAMP PRO 5) from Coldfusion 2018 and couldn't figure this out for days. MAMP PRO support not helpful.

I did the following to fix. All apps are on my local Macbook PRO:

  1. In MAMP PRO 5, checked OFF 'allow network access' on the MySQL tab.
  2. Changed my 'root' password in MySQL via MAMP PRO
  3. Checked ON 'allow network access'.
  4. Stopped and restarted MySQL and Apache via MAMP PRO.
  5. In Sequel Pro and Coldfusion used '127.0.0.1' as the host with 'root', my new password, and port 8889. Both worked!
0

精彩评论

暂无评论...
验证码 换一张
取 消