Can't connect to MySQL [ColdFusion MX 7] on Linux

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Can't connect to MySQL [ColdFusion MX 7] on Linux

    I'm running a linux server (Ubuntu 5.10), and have successfully installed the
    developer's version of ColdFusion MX 7. It's correctly installed ( I can
    login to the administrator ok), but I can't connect to my localhost MySQL
    database. I get the following error:
    ------
    Connection verification failed for data source: ******
    java.sql.SQLException: Timed out trying to establish connection
    The root cause was that: java.sql.SQLException: Timed out trying to establish
    connection
    -------

    I found some instructions that said to manually make sure the proper Connector
    class was installed. I installed the newest MySQL Connector/J in
    /usr/local/addons on my server.
    The full path to it reads:
    /usr/local/addons/mysql-connector-java-3.1.11

    The instructions I had found said to put the .jar file from the above
    mysql-connector folder into the /lib directory of the ColdFusion folder. So I
    put

    mysql-connector-java-3.1.11-bin.jar into the ColdFusion folder. I then also
    clicked on the "Java and JVM" section in the ColdFusion administrator, and put
    this in the "ColdFusion Class Path" section:
    /opt/coldfusionmx7/lib/mysql-connector-java-3.1.11-bin.jar

    I restarted the server, but I still get the same error. Does anyone have any
    experience manually installing an appropriate JDBC Connector for ColdFusion on
    Ubuntu? Any help would be appreciated. Thanks.

    punjab4833 Guest

  2. Similar Questions and Discussions

    1. #40207 [NEW]: Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL ser
      From: arif at peshawaronline dot com Operating system: PHP version: 4.4.4 PHP Bug Type: Compile Warning Bug description: ...
    2. ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
      When i try to start my mysql server, i get this error ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'...
    3. Cannot connect to SQL 2k from MX7 (Linux)
      Can someone confirm|deny that MX7 JDBC drivers fail to connect to a SQL 2k *SP4* server when the "force protocol encryption" is enabled? Same is...
    4. Seen this message? Can't connect to local MySQL server through socket '/tmp/mysql.sock'
      Seen this message? Can't connect to local MySQL server through socket '/tmp/mysql.sock' I got this trying to install DBI and DBD for mysql from...
    5. Seen this message? Can't connect to local MySQL server throughsocket '/tmp/mysql.sock'
      Allen Marshall wrote: I just saw it in another newsgroup. Don't multi-post! -- Gunnar Hjalmarsson Email:...
  3. #2

    Default Re: Can't connect to MySQL [ColdFusion MX 7] on Linux

    punjab4833 wrote:
    > I'm running a linux server (Ubuntu 5.10), and have successfully
    > installed the developer's version of ColdFusion MX 7. It's
    > correctly installed ( I can login to the administrator ok), but I
    > can't connect to my localhost MySQL database. I get the following
    > error: ------
    > Connection verification failed for data source: ******
    > java.sql.SQLException: Timed out trying to establish connection
    > The root cause was that: java.sql.SQLException: Timed out trying to
    > establish connection
    > -------
    Is your MySQL server running ? Do you have a firewall on the machine ?
    Can you connect using telnet (telnet localhost 3306) ? If yes, can you
    connect using mysql -u #your_user# -p #your_database# ?

    --
    <mack />


    Neculai Macarie Guest

  4. #3

    Default Re: Can't connect to MySQL [ColdFusion MX 7] on Linux

    Yes, the server is running. I have other applications (i.e., PHP) successfully
    talking to the database. I can login with the username I'm supplying it. As
    far as I can tell, the error appears to be something with ColdFusion not
    properly using (or maybe even finding) the jdbc driver.

    Anyone have any experience installing the jdbc connector manually? Is all I
    have to do put the jar in the ColdFusion folder and in it's classpath, or do I
    have to actually extract out the classes too? Please help, this is driving me
    crazy.

    punjab4833 Guest

  5. #4

    Default Re: Can't connect to MySQL [ColdFusion MX 7] on Linux

    What happens when you add this, instead, to your classpath:

    /usr/local/addons/mysql-connector-java-3.1.11

    BKBK Guest

  6. #5

    Default Re: Can't connect to MySQL [ColdFusion MX 7] on Linux

    I tried what you suggested BKBK, but still no dice. As to what Neculai
    suggested, maybe that is the problem...
    When I tried to do 'telnet localhost 3306' this what happens:
    -----
    Trying 127.0.0.1...
    Connected to localhost.localdomain.
    Escape character is '^]'.
    NHost 'localhost.localdomain' is not allowed to connect to this MySQL
    serverConnection closed by foreign host.

    -----

    Any thoughts?

    punjab4833 Guest

  7. #6

    Default Re: Can't connect to MySQL [ColdFusion MX 7] on Linux

    The host in the MySQL table is always localhost. Is that the problem? Does the driver try to connect to 'localhost.localdomain' by default?

    punjab4833 Guest

  8. #7

    Default Re: Can't connect to MySQL [ColdFusion MX 7] on Linux

    The host in the MySQL table is always localhost. Is that the problem?
    Does the driver try to connect to 'localhost.localdomain' by default?
    No, it tries to connect to the values that you entered for the settings
    Server Host and Port when you configured MySQL. They should
    be 127.0.0.1 and 3306 respectively.

    BKBK Guest

  9. #8

    Default Re: Can't connect to MySQL [ColdFusion MX 7] on Linux

    punjab4833 wrote:
    > Yes, the server is running. I have other applications (i.e., PHP)
    > successfully talking to the database. I can login with the username
    > I'm supplying it. As far as I can tell, the error appears to be
    > something with ColdFusion not properly using (or maybe even finding)
    > the jdbc driver.
    I think that the driver is properly installed (otherwise the error would
    have said something about not finding the driver). Can you double check the
    parameters you entered in the admin area (and see if MySQL is really
    listening on the IP that you specified ) ?

    > Anyone have any experience installing the jdbc connector manually?
    > Is all I have to do put the jar in the ColdFusion folder and in it's
    > classpath, or do I have to actually extract out the classes too?
    > Please help, this is driving me crazy.
    You could try putting the jar file in $CF_HOME/runtime/servers/lib/ and
    restarting CF. Then use the "Other" datasource type to create your
    datasource.

    --
    <mack />


    Neculai Macarie Guest

  10. #9

    Default Re: Can't connect to MySQL [ColdFusion MX 7] on Linux

    I'm using a pc, but I had the same problem and I think it should work for you.
    The problem is that you are putting the file in the wrong lib. the lib should
    be the one in wwwroot/WEB-INF/lib/ and then your file.
    CF Data Source Name : db(example)
    JDBC URL: jdbc:mysql:/127.0.0.1:3306/db
    Driver Class: com.mysql.jdbc.Driver

    This is case sensitive when you are creating your datasource in coldfusion.
    Make sure that you are selecting other as your driver. Hope this helps.

    fou99004 Guest

  11. #10

    Default Re: Can't connect to MySQL [ColdFusion MX 7] on Linux

    Thanks, I got it working now. I think the problem is that I was putting in the
    JDBC URL as: jdbc:mysql://localhost:3306/db

    The extra forward slash after the mysql: did it I guess..? Thanks again to
    all who replied.

    punjab4833 Guest

  12. #11

    Default Re: Can't connect to MySQL [ColdFusion MX 7] on Linux

    Hi
    can u tell me the steps to be followed to install Coldfusion MX 7 on ubuntu
    prasadvishnu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139