Trouble connect MySql database on cluster

Dear Friends
I am trying to connect the MySql database on our cluster which have ROCKS cluster ebvironment on it. My code is just a test code to connect to the "test" database and i got fallowing exception
Exception: Data source rejected establishment of connection, message from server: "Host 'chemdynm.chem.ttu.edu' is not allowed to connect to this MySQL server"
Can anybody help me on this problem.My test code is as fallows
Thanks
Nav
import java.sql.*;
public class dbtest
     public static void main(String[] args)
     Connection con = null;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql://chemdynm.chem.ttu.edu/test",
"root", "secret");
if(!con.isClosed())
System.out.println("Successfully connected to " +
"MySQL server using TCP/IP...");
} catch(Exception e) {
System.err.println("Exception: " + e.getMessage());
} finally {
try {
if(con != null)
con.close();
} catch(SQLException e) {
          System.out.println("here is the problem " +e);

Read the MySQL documentation about how to set up permissions. Not only do you have to declare permissions for each user ID, you also have to declare permissions for the hosts they may connect from. This is nothing to do with Java or JDBC.

Similar Messages

  • How to connect mysql database using xml

    welcome to all,
    here my doubt is how to connect mysql database using xml file, how to integrate xml file and jsp file and how to access data from dabase using jsp file. can any one help me
    regards

    Short answer: you wouldn't do any of those things. The first two are meaningless and the third is a bad practice. I have no idea what those ideas were supposed to achieve so I have no idea what tutorials I should suggest to you.

  • How to Connect MySQL Database Through JTable?

    Hi,
    How to Connect MySQL Database Through JTable? anyone of u knows these concept please send me coding of that Part..
    Thanks,
    Guru..

    Start by reading the tutorials. There's a section on Swing which shows you how to use tables and a section on JDBC which shows you how to use SQL.
    And you can always search the forum as well since there are working examples of both posted on the forum.
    If you need further help with a specific problem then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the [Code Formatting Tags|http://forum.java.sun.com/help.jspa?sec=formatting], so the posted code retains its original formatting.

  • How to connect mySQL database with jdbc

    Who can tell me how to connect mySQL database with jdbc? Thanks

    http://onesearch.sun.com/search/developers/index.jsp?and=connect+mysql&nh=10&phr=&qt=&not=&field=title&since=&col=devforums&rf=0&Search.x=24&Search.y=16

  • How to connect MySql database with JSP

    Dear everyone,
    how to connect MySql database with JSP......

    It's too bad that nobody has ever asked this question before...

  • Getting exception while trying to connect mysql database

    hi
    i am using mysql as database while connecting to database using jsp i am getting the following exception
    "java.lang.ClassNotFoundException:com.mysql.jdbc.Dr iver"
    can any one tell wha tis the actual problem
    regards

    If you've tens of applications on the server which
    makes use of the same driver/JAR, then you can put
    this JAR in the classpath of the server to save
    WAR/EAR space. And about differing versions: I am not
    used to do so. Otherwise just put the different/older
    version in the classpath of the webapp and then give
    it higher priority in the classloader.If you are using Enterprise Applications, disk space for the code should be your last concern. If you don't have enough of that for each of the applications to have their own space for the third party jars that they use, then you need a new server, as the one you have is not going to be able to handle the load anyway.
    And as far as fiddling around with the classpath to avoid jarfile "collision" or incapability, good luck. The first time you add a new application all the others will stop working and you will have to spend two days reordering the classpath properly, so that they all work again. I know, because I have seen it happen, even though I suggested to them to do it the other way, they insisted on doing things the way you suggested and, like I said, as soon as they added the next application, the server was down for two days, until they got all of the classpath/(classloader priority) issues straightened out.

  • Error while connecting MYSQL Database

    Hi,
    I use a 30 days trial of Crystal Reports 2008. When i try to connect with the database i always get the next error: [http://www.visiscan.nl/error.jpg]
    The database is 4.1GB large and there is 10GB free space on the database.
    Anybody can tell me what to do?

    Hi Tom,
    As I understand the error while connecting to database is
    u201CFailed to retrieve data from databaseu201D
    There could be some could be multiple reasons for this.
    If you are using an ODBC connection then try to check the DSN. Recreate the same and then try.
    If the database is oracle check if native client is installed and try to ping from the native client to check if it responds.
    When connecting to Oracle, ensure that the Service name is identical to that used in the <ORA_HOME>/network/admin/tnsnames.ora file on the BusinessObjects XI Release 2 server.
    For ODBC databases, ensure that the ODBC DSN is exactly the same in the ODBC Manager as on the BusinessObjects XI Release 2 server.
    Please let us know if this helps
    Regards,
    Aditya Joshi

  • Having Trouble Linking mySQL Database to Website

    I am considering a move of all my websites into Azure and setup a test account this afternoon with the free trial.  I've been able to setup the website; however, I'm having issues with the creation - more specifically the linkage - of a MySQL database
    to the site.  I've tried to link the database in a number of ways including both the existing and preview portals in addition to trying to create the new resource instead of linking. In each scenario the database is created but the linkage fails. 
    The message I keep getting is:
    Could not link resource '>DB Name>' to web site '<Site Name>'.
    Am I doing something wrong?

    hi sir,
    Thanks for you posting!
    Firstly, please make sure your MySQL database in host on Azure, not in your project.
    Secondly, if your database is create on Azure, I suggest you could try those step:
    1.delete the entire website
    2.create a new website and select add the existing MySQL database as a Linked Resource .
    Also, please see this similar issue post:
    http://stackoverflow.com/a/12198776
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to connected mysql database to iphone app?

    I make application which must use mysql database because my application is related to other desktop application

    If the app uses the same db as on the user's computer, you should look into using iCloud to share and sync the data. Visit the iOS Dev Center for details.

  • How to connect mysql database to labview and plot the graph

    Hi all,
     I am doing my final year project about labview. I need to connect my mysql workbench database to labview and plotting two sinwave in same graph. I can already connected my labview to mysql and showing the data in labview table.But I need to plot the two sinwave in on graph according to table data. Eg: table data&colon;      timestamp   wind speed  wind direction
                                                      ​                                                  ​                                                  ​                                            2004-01-01         0.5                 56
                                                      ​                                                  ​                                                  ​                                            2004-01-01         0.6                 60
      The attachemtn vi is about inserting file and plot the graph. And now I  want plotting the sinwave using table data and the  wind speed Y-axis,wind direction Y-axis in both side of my graph and the X-axis is showing the whole day timing like 00:00:00-24:00:00.  Can anybody combine these 2 vi to polting the graph according table data not according to file data.Thanks
    Attachments:
    Mysql.vi ‏11 KB
    Insert File.vi ‏25 KB
    Wind Project.vi ‏24 KB

    Please don't start a new thread. Stick to the original.
    http://forums.ni.com/t5/LabVIEW/How-to-plot-wavefo​rm-or-graph-using-table-database-which/td-p/294036​...

  • Connecting mysql database to dreamweaver

    when i try to upload database which i did in mysql to the
    webserver from dreamweaver by doing: view - live data in
    dreamweaver i get this message: "the testing server did not execute
    any of the scripts in your document.possible explanations
    include:1. the testing server is not running 2. the testing server
    ignores files with the php. extension. 3. your document does not
    contain any scripts"
    my webserver is xampp (appache + mysql) and below are the
    scripts which i used:
    also when i do F12 the images in the database appear gibrish
    on the webserver page.
    what did i do wrong ?

    noa2 wrote:
    > when i try to upload database which i did in mysql to
    the webserver from
    > dreamweaver by doing: view - live data in dreamweaver i
    get this message: "the
    > testing server did not execute any of the scripts in
    your document.possible
    > explanations include:1. the testing server is not
    running 2. the testing server
    > ignores files with the php. extension. 3. your document
    does not contain any
    > scripts"
    It sounds as though you have not defined the testing server
    correctly in
    your Dreamweaver site definition.
    > my webserver is xampp (appache + mysql) and below are
    the scripts which i used:
    > also when i do F12 the images in the database appear
    gibrish on the webserver
    > page.
    You should not store images inside the database. Or if you
    do, you need
    to write a proxy script to display them. The normal procedure
    is to
    store the details of images (such as filename) in the
    database, but keep
    the images themselves in the normal file system. Use the
    filename from
    the recordset result to build the <img> tag to display
    the image.
    > mysql_connect("","","");
    Using mysql_connect() with only empty strings as arguments
    means you
    have a totally unprotected database.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Connect mysql database php

    I HAVE HOST ON YAHOO AND THIS SCRIPT DOSN'T WORK WITH YAHOO
    can u help me ....
    <?php
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_midcommerce = "localhost";
    $database_midcommerce = "DATABASE";
    $username_midcommerce = "USER";
    $password_midcommerce = "PASSWORD";
    $midcommerce = mysql_pconnect($hostname_DATABASE,
    $username_DATABASE, $password_DATABASE) or
    trigger_error(mysql_error(),E_USER_ERROR);
    ?>

    > # FileName="Connection_php_mysql.htm"
    Is that the correct filename? Shouldn't it be a php file?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "amooor" <[email protected]> wrote in message
    news:et677e$seq$[email protected]..
    > I HAVE HOST ON YAHOO AND THIS SCRIPT DOSN'T WORK WITH
    YAHOO can u help me
    > ....
    >
    > <?php
    > # FileName="Connection_php_mysql.htm"
    > # Type="MYSQL"
    > # HTTP="true"
    >
    > $hostname_midcommerce = "localhost";
    > $database_midcommerce = "DATABASE";
    > $username_midcommerce = "USER";
    > $password_midcommerce = "PASSWORD";
    > $midcommerce = mysql_pconnect($hostname_DATABASE,
    $username_DATABASE,
    > $password_DATABASE) or
    trigger_error(mysql_error(),E_USER_ERROR);
    > ?>
    >

  • Trouble starting Netca, Trouble connecting to database

    Hello All. I am trying to connect to a remote installation of Oracle XE and using the Enterprise Manager. It gives me a 'cannot parse ...' error when I manually type the db details. netca will not start on my machine to create a tnsnames.ora entry. Any ideas? TIA

    Howdys, I am actually not getting any error at all. I click on the link and nothing comes up. I am using windows Vista. Is there a Netca log file I can view that might give clues? Newbie out.

  • IIS7 + ColdFusion 9 connection to MySQL database

    Hi,
    I have set ColdFusion 9 and IIS7 now, it  needs to connect MySQL database from ColdFusion 9.
    What I still need to make it all work.
    Please tell me how do I connect to my MySQL database from ColdFusion
    Thank you.

    When I configure Flex. The combination of ColdFusion server when setting location, set on a standalone and there is automatically selected Deployed to J2EE server. Why is this happening?

  • MySQL database connection from Custom JSP

    I am trying to connect MySQL database from my custom JSP. I am getting following error which says that the connector JAR (mysql-connector-java-5.1.7) is not in CLASS PATH.
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    Where should I need to add to get by custom JSP during run time of BPM Studio or Workspace?
    I have tried in adding to External resources. But didn't work that way. even I tried adding to "lib" folder in resource view.
    My Custom JSP code:_
    <%@ page language="java" import="java.sql.*" %>
    <html>
    <head></head>
    <body>
    <%     
    System.out.println("MySQL Connect Example.");
    Connection conn = null;
    String url = "jdbc:mysql://localhost:3306/";
    String dbName = "aboo";
    String driver = "com.mysql.jdbc.Driver";
    String userName = "monty";
    String password = "some_pass";
    try {
    Class.forName(driver).newInstance();
    conn = DriverManager.getConnection(url+dbName,userName,password);
    System.out.println("Connected to the database");
    String query = "Select * FROM employeee";
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next()) {
    System.out.println(rs.getInt(1));
    System.out.println(rs.getString(2));
    conn.close();
    System.out.println("Disconnected from database");
    } catch (Exception ee) {
    ee.printStackTrace();
    %>
    </body>
    </html>
    Edited by: sideeque on Jul 7, 2009 9:38 AM
    Edited by: sideeque on Jul 7, 2009 9:39 AM

    I got it working by just adding JAR to C:\OraBPMStudioHome\webapps\workspace\lib

Maybe you are looking for