Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Problems setting up a datasource from CF9 to MySQL 5.1

Community Beginner ,
Sep 21, 2010 Sep 21, 2010

I have a MySQL database sitting on a Windows server (yes, Windows, not any variety of Unix). The same server also runs CF9, and a lot of websites as a result, and all of this is working happily.

A few months ago, I set up the PC on my desk to run CF9, so I could use it for development purposes. I set up datasources to my MySQL database, using the MySQL (4/5) driver, and once I'd opened up the firewall on the server to let port 3306 through, again all was well.

Now I have a new desktop PC. I'm trying to do the same thing.  If I try to set up a datasource, I get

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

Unfortunately, I can't remember what else I might have done on my previous desktop PC to get this working, and it's now being used by a colleague, so I can't spend much time on it investigating: a quick look showed nothing abnormal.

If I Telnet the server, I can get a reply as long as I specify the port, and a look at the firewall tells me that that port is open for all IPs, so I don't think it's a firewall/IP problem.

I don't know much about MySQL, and anything I Google assumes I'm on a Unix server for some reason. Could there be a MySQL setting that's restricting the IP address?

Is there something in CF9 Admin I need to set? I installed with the defaults.

I've tried the alternative driver specifed in this tech note, and got the same result.

Edit: it occurs to me that one known difference between old PC and new PC is that I used to have admin rights on my account, and on the new PC, I don't. I can log on as admin if I need to, and did to install CF, but I don't haev those rights by default. I can't imagine how this would change anything, but thought I'd mention it.

TOPICS
Database access
795
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 21, 2010 Sep 21, 2010

Sounds like a permissions issue. What account is your CF9 running under? Check services.msc to see.

Is it LocalSystem? Does the account it is running under have access to the db server?

Swift

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 21, 2010 Sep 21, 2010

It's running under Local System. Let me check the previous PC, since that will only take the new user a moment... that, too, is running under Local System.

I don't know how to check if that has access to the DB server.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 22, 2010 Sep 22, 2010
LATEST

OK, problem found, and bypassed.

In MySQL, the root account had been set up to only talk to localhost.

I've created a new account, given it access to the DB I need (and nothing else), and used it - all is well.

I have no idea why the account I was using on my old PC failed to work on this one, but password typos seem likely.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources