facebook

cant connect to mysql database [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #220036 Reply

    rishvika
    Member

    Hi
    i am using eclipse 3.0, MyEclipse 3.8.2
    I am folllowing the steps from help document database explorer quick start Last Revision: October 26, 2004.
    after creating the connection profile i am opening a database connection.
    and i am unable to connect to database.
    hope any one by seeing the logfile can help me further, to come out of the problem.

    mysql server is on network,i am using as an user.
    jdbc:mysql://servername:3306/mysql
    driver used: MySQL Connector/J Driver
    i tried in all ways:

    below is my log file:
    ——————————
    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 Nov 25, 2004 16:28:58.468
    !MESSAGE Error while trying to login to database
    !STACK 0
    java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.SocketException: Malformed reply from SOCKS server

    ** BEGIN NESTED EXCEPTION **

    java.net.SocketException
    MESSAGE: Malformed reply from SOCKS server

    STACKTRACE:

    java.net.SocketException: Malformed reply from SOCKS server
    at java.net.SocksSocketImpl.readSocksReply(Unknown Source)
    at java.net.SocksSocketImpl.connectV4(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:124)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:225)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:1783)
    at com.mysql.jdbc.Connection.<init>(Connection.java:450)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
    at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:99)
    at com.genuitec.eclipse.sqlexplorer.sessiontree.actions.LoginProgress$Login.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    ** END NESTED EXCEPTION **

    at com.mysql.jdbc.Connection.createNewIO(Connection.java:1851)
    at com.mysql.jdbc.Connection.<init>(Connection.java:450)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
    at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:99)
    at com.genuitec.eclipse.sqlexplorer.sessiontree.actions.LoginProgress$Login.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    thank u,

    #220067 Reply

    rishvika
    Member

    Hi ,
    i am out of problem. now every thing works perfect.
    thanks for the developers for a wonderful product 😀

    #220077 Reply

    Scott Anderson
    Participant

    Sorry we couldn’t get back to you, but it’s a long holiday weekend (Thanksgiving) in the US. Could you follow up with what you changed so that everything works for you? It will certainly help other developers with the same problem that search and find this thread. 🙂

    Thanks in advance.

    #220135 Reply

    rishvika
    Member

    i too dont know what exactly the problem ? next day morning i tried once, then every thing works good.
    hope developers by seeing my logfile can have some idea regarding this.

    #235332 Reply

    I have a smilar problem but I am unable to fix it can someone help me?

    #235336 Reply

    Riyad Kalla
    Member

    Can you please post all the information we request in the [URL=http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-393.html]Posting Guidelines[/URL] thread at the top of this forum? That will give us some context so that we can determine if this is an installation issue, a configuration problem, or a bug. Thanks.

    #246976 Reply

    I need to Steps to connect Mysql with eclipse ide. I need the path where i have to store the database . Please help me . it is very urgent. mail to murugan_btech@yahoo.com

    #257128 Reply

    BMRao
    Member

    I need Steps to connect Mysql with eclipse ide. I need the path where i have to store the database . Please help me . it is very urgent. mail to bmrao2002@gmail.com

    #257160 Reply

    Brian Fernandes
    Moderator

    The steps to be followed are presented in great detail in the Eclipse help system. Please start eclipse and check Help > Help Contents > MyEclipse Learning Center > Database Development > Getting Started > Working with Database Explorer.

    Best,
    Brian.

    #263490 Reply

    Anouarzh
    Member

    Hello guys

    I have two computers at home

    One linux server which i use as a server with mysql installed and working.
    And my laptop where i have installed eclipse whit Java.

    I want to connect to my database using mysql-connector-java-3.1.14
    I have installed the driver in eclipse ( added the package )
    Als i have installed the sql plugin of eclipse to help met out, but also that does not work.

    
       import java.sql.*;
    
       public class Java_db
       {
           public static void main (String[] args)
           {
               Connection connection = null;
               try {
    //            Load the JDBC driver
               String driverName = "com.mysql.jdbc.Driver"; // MySQL MM JDBC driver
               Class.forName(driverName);
    
    //            Create a connection to the database
               String serverName = "192.xxx.xxx.xxx";
               String mydatabase = "test";
               String url = "jdbc:mysql://" + serverName + "/" + mydatabase; // a JDBC url
               String username = "xxx;
               String password = "xxxx";
               connection = DriverManager.getConnection(url, username, password);
               } catch (ClassNotFoundException e) {
    //            Could not find the database driver
                   System.out.println("Could not find Db driver");
               } catch (SQLException e) {
    //            Could not connect to the database
                   System.out.println("Could not connect to the db");
               } 
           }
       }
    
    

    When i Run this program it says

    Can not connect to db

    Can somebody please help

    Thnx in advance

    Anouar

    #263589 Reply

    Brian Fernandes
    Moderator

    Anouar,

    This is because your MySQL database server has not been started or it is not reachable from the machine you are running MyEclipse / Java program from.
    There is nothing wrong with MyEclipse or your program, you just have make sure the server has started and is reachable.

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: cant connect to mysql database [Closed]

You must be logged in to post in the forum log in