Skip to main content
Known Participant
May 21, 2008
Question

Connecting to MySQL

  • May 21, 2008
  • 11 replies
  • 1588 views
I am trying to connect to MySQL (I just downloaded and implemented it). In the past, I have only used Access and SQL. I cannot seem to connect. Can someone point me in the right direction please?

Here is the message I am receiving...

Connection verification failed for data source: farcry
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.UnknownHostException MESSAGE: (local) STACKTRACE: java.net.UnknownHostException: (local) at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1200) at java.net.InetAddress.getAllByName0(InetAddress.java:1153) at java.net.InetAddress.getAllByName(InetAddress.java:1083) at java.net.InetAddress.getAllByName(InetAddress.java:1019) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:163) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:267) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2739) at com.mysql.jdbc.Connection.(Connection.java:1553) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at coldfusion.server.j2ee.sql.pool.JDBCPool.createPhysicalConnection(JDBCPool.java:589) at coldfusion.server.j2ee.sql.pool.ConnectionRunner$RunnableConnection.run(ConnectionRunner.java:67) at java.lang.Thread.run(Thread.java:619) ** END NESTED EXCEPTION ** Last packet sent to the server was 0 ms ago.
The root cause was that: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.UnknownHostException MESSAGE: (local) STACKTRACE: java.net.UnknownHostException: (local) at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1200) at java.net.InetAddress.getAllByName0(InetAddress.java:1153) at java.net.InetAddress.getAllByName(InetAddress.java:1083) at java.net.InetAddress.getAllByName(InetAddress.java:1019) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:163) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:267) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2739) at com.mysql.jdbc.Connection.(Connection.java:1553) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at coldfusion.server.j2ee.sql.pool.JDBCPool.createPhysical...
This topic has been closed for replies.

11 replies

Adobe Employee
May 23, 2008
Also make sure to grant proper access to the root user or any other user you want to use. Mysql does not seem to provide proper permissions to the root user also.

HTH,
Swathi.
Inspiring
May 23, 2008
it looks like your mysql installation is not fully configured...
you MUST provide a username and password at install. the default
username, iirc, is root, ut i think you have to specify a password for
it at install....

mysql by default installs on localhost with port 3306 - use that in your
cf dsn connection setup (those are defaults there as well).

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Inspiring
May 23, 2008
fs22 wrote:
> When I installed MySQL, I did not specify a user name and password.

Then you should fix that first and then specify them in CF.

Jochem

--
Jochem van Dieten
Adobe Community Expert for ColdFusion
fs22Author
Known Participant
May 22, 2008
When I installed MySQL, I did not specify a user name and password.
Inspiring
May 22, 2008
fs22 wrote:
> Connection verification failed for data source: farcry
> java.sql.SQLException: Access denied for user ''@'localhost' (using password:
> NO)

So fill in the username and password.

Jochem


--
Jochem van Dieten
Adobe Community Expert for ColdFusion
fs22Author
Known Participant
May 22, 2008
Thanks...did that and received the following error...

Connection verification failed for data source: farcry
java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO)
The root cause was that: java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO)
Inspiring
May 22, 2008
fs22 wrote:
> I installed MySQL locally on my C drive...are you saying that I simply need to provide the folder location such as C:\Program Files\MySQL?

A folder location is not a FQDN or an IP address. Just enter 127.0.0.1.

Jochem

--
Jochem van Dieten
Adobe Community Expert for ColdFusion
fs22Author
Known Participant
May 21, 2008
I installed MySQL locally on my C drive...are you saying that I simply need to provide the folder location such as C:\Program Files\MySQL?
Inspiring
May 21, 2008
fs22 wrote:
> Connection verification failed for data source: farcry
> com.mysql.jdbc.CommunicationsException: Communications link failure due to
> underlying exception: ** BEGIN NESTED EXCEPTION **
> java.net.UnknownHostException MESSAGE: (local) STACKTRACE:
> java.net.UnknownHostException: (local) at

"local" is not a valid hostname for the MySQL server. Use a FQDN or an
IP address.

Jochem

--
Jochem van Dieten
Adobe Community Expert for ColdFusion
fs22Author
Known Participant
May 21, 2008
CF8 & MySQL 5.1...as far as the connection settings...that is what I am wondering about.