Can't connect Coldfusion 10 to mysql 5 - mysql

I am trying to setup a test coldfusion server running on my home PC (Windows 8 Pro 64 bit). I have Coldfusion 10 installed, and mysql 5.6.10 working as well. When I try to connect them, I am getting the following error:
Connection verification failed for data source:
mydbcom.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've looked all over the place, and I can't seem to figure out what I need to do to fix it.
Thanks in advance.

What's your DSN definition in CF Admin look like? Did you create a MySQL user that has access to that database, which you then used in your CF Admin DSN connection?
EDIT:
Yes, you should never connection as "root" by practice. Create a new user and give them the correct permissions to your database. I've got some instructions here if you need them.
http://iknowkungfoo.com/blog/index.cfm/2008/6/16/The-ACME-Guide-64bit-Ubuntu-804-Edition-Part-3

The trick for me was to type in the IP address for the server address when adding a new CF ADMIN DSN entry. Using local, localhost or 127.0.0.1 for the server address did not work for me.

Related

Can't connect to MySQL server (hosted by strato) error: 2013 lost connection to mysql server at 'reading initial communication packet' system error 0

Hi I am trying to connect to my MySQL DB which is hosted by strato. On their site I can create a DB and I did. I am able to connect via PuTTy like shown in this link. And I found the port, hostname etc as you can see but now I am trying to connect to the database via NaviCat but I keep getting the following error: 2013 lost connection to mysql server at 'reading initial communication packet' system error 0.
I configured NaviCat like this (as password I filled in the masterpassword strato provided me)
and this (as password I filled in the masterpassword strato provided me)
Screenshot of the error I am getting:
There is also a page on my hosters site with an tutorial on how to connect to their DB using PuTTy: link to page
Maybe you're wondering why I don't contect the host, it takes ages for them to reply...
What am I doing wrong why cant I connect how can I fix it?
If anyone can help me i would rlly appreciate it!
The manual says the hostname for a database connection should be
rdbms.strato.de
Or has this never been possible? I quote Can not connect to mysql database [strato]:
Connection posibilities(access) depends on your hosting package. But,
actually, remote connections to strato mySQL is not allowed(security
reasons). I have the same trouble with PowerWeb Basic.
The access is probably meant for applications you host with them, not running elsewhere (eg. at home).
If you want to work locally, perhaps they allow you to take a dump of your database that you can install locally? Do they have PHPMyAdmin?

VB.net - Connect to Database

I got mysql database in the phpmyadmin, and i try to connect to the database from my application.
My connection string is:
Server=12.919.18.12;Port=3306;Database=hbd;Uid=hb;Pwd=123;
An exception occurs:
"Unable to connect to any of the specified MySQL hosts."
Do I need to install mysql or something?
(I just imported MySql.Data.dll and tryied it. Is there anything I have forgotten? I checked the ip pinging my website).
Connection strings for MySQL
is pretty helpful in terms of connection strings. Your connection
string seems to be invalid.
You may check mysql server is working or not and you can add port number of mysql in connection string like this
"Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;"
Other reason MySql might be configured to listen to only the local host.
Follow the following links for more information:
Enabling MySQL Remote Access - MySQL connection only works from local machine
Unable to connect to any of the specified MySQL hosts.
IP is invalid 12.919.18.12
Server=12.919.18.12;Port=3306;Database=hbd;Uid=hb;Pwd=123;
IP block is < 256
If the datababase is local, try localhost or 127.0.0.1 as the IP address.
Is the server on your network? If so, the IP is invalid. If I were you, I'd try to check the IP with the person who gave it to you.
the connection string is correct but as ive read a lot of forums they all have the same problems as you do. my solution is that if your trying to create a network base system on a LAN type network you should use XAMPP or WAMPP but i prefer xampp and double check if your accounts or users have an Admin or any other user name for your connection and then see if they have granted all the privileges and with password of course.
Here is the ff instructions:
Open Xammp
Then open a web browser then open 127.0.0.1 or localhost.
click phpmyadmin then at the top click privileges.
add user and make it sure allow all privileges and check all access.
then connect again using the same connection string with the proper user and password.
This issue is RESOLVED :)
try to put the PORT in the end like :
"Server=12.919.18.12;Database=hbd;Uid=hb;Pwd=123;Port:3306;"

Tomcat7 MySQL Connection Error

I'm facing a perplexing problem. I've completed a jsf web app that utlizes hibernate and infinispan with Tomcat7 and tomcat-jdbc-pool as the connection pool provider.
It is being deployed to a Linode cluster w/ 2 nodes -- one database server and one production server.
I can run the app on my local environment using the exact same copy of Tomcat7 (I literally tarred the tomcat directory and promoted it to the server to debug this error) -- even when connected to the live database instance. Everything runs fine.
When I attempt to run the application from the production server I get a MySQLIO error:
Caused by: java.net.ConnectException:
Connection refused
Looking further up in the logs i see:
The last packet sent successfully to
the server was 1 milliseconds ago. The
driver has not received any packets
from the server.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
I can connect from the command line on the prodapp server just fine -- even using tcp:
mysql -h db01 -u user -p --protocol=tcp
But it just won't work running inside the Tomcat container. I've tried all kinds of things but I'm really stumped. It just seems strange that I can connect to the database server using the same copy of Tomcat7 locally but when deployed to production the same copy of tomcat7 can't connect -- even though I can connect from the command line on that production server ... I'm stumped.
Any help is greatly appreciated.
EDIT: Solved my problem after wasting too much good life on it. The answer was I'm stupid. Thanks to everyone who tried to help. I have the app moded w/ a dev and live mode and the connection pool was reading the dev mode this whole time. What really made it confusing is that the sessionfactory was moded to live so it would actually reach the live database and initialize a connection when it started up so i could see it connecting (and running meta data queries in the mysql log), but when it actually went to grab a connection from infinispan it blew up. Oh well -- at least it's working now. Thanks again.
If you're connecting to your MySQL database server from a different box, then you need to explicitly grant permission for that user account to connect from that IP.
You can do this whilst in the command line:
GRANT ALL PRIVILEGES ON *.* TO 'username'#'ip_address'
EDIT: Granting all permissions on all tables generally isn't required, be specific about what permissions you want to grant (http://dev.mysql.com/doc/refman/5.1/en/grant.html)
To see what permissions you currently have:
USE mysql;
SELECT * FROM users;
My apologies if I'm patronising you, just that this is the most common problem that I come across.

Connecting Funambol to MySQL on remote host

I am setting up Funambol 8.7 on a Linux host (using Amazon AWS). I need to connect to a MySQL datbase that is hosted on a different server.
Per the administration guide I went ahead and downloaded the mysql connector and placed the jar in /opt/Funambol/tools/jre-1.6.0/lib/ext. I changed the install.properties file as follows:
dbms=mysql
jdbc.classpath=/opt/Funambol/tools/jre-1.6.0/jre/lib/ext/mysql-connector-java-5.1.14-bin.jar
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://myserver.net/rugcutte_funambol?characterEncoding=UTF-8
jdbc.user=rugcutte_funambo
jdbc.password=funambol
THen I try to run the install, but get the following error:
/opt/Funambol/ds-server/install/install.xml:452: java.sql.SQLException: Access denied for user 'rugcutte_funambo'#'ec2-50-16-233-200.compute-1.amazonaws.com' (using password: YES)
It appears my AWS instance can connect successfully to my MySQL database however it is trying to login with a fully qualified user name that is incorrect: rugcutte_funambo'#'ec2-50-16-233-200.compute-1.amazonaws.com
I tried also to change the line to : jdbc.user=rugcutte_funambo#myserver.net . But I got a similar error with that as well.
I am relatively inexperienced to JDBC. What is the proper way to set up this section of the install.properties file?
Did you enable access to that database with that user from that server?
What happens if you try and just make the same mysql connection from the command line from your Funambol server?
Thanks Adam.
You led me to the correct answer. The remote host has an area in cPanel to configure Remote Database Access Hosts. So I did, need to add my source host that is running Funambol, to my list of access hosts.
After this I ran the install and it did, appear to create the tables properly in the database running on my remote host.

Connecting Coldfusion 9 with MySql 5 on Ubuntu 9.10

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?
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.
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.
Try using 127.0.0.1 as the MySQL server address in your DSN configuration