Java - Mysql
I have a problem connecting to MySQL remotely. I believe I have configured JDBC correctly i.e. extracting the mysql*.jar and setting the enviroment variables for the path.
I can connect to a MySQL database that is on the same machine (Windows XP) as the code I'm executing, however, I wish to conenct to a remote database on a server. I am using the following code to connect to it.
Connection conn = DriverManager.getConnection
("jdbc:mysql://220.127.116.11/mysql", "user", "pasword");
where "18.104.22.168" is the ip address of the server I am trying to connect to. I have tried accessing two different servers running MySQL - a Red Hat Liniux Enterprise 3 Server and a Fedora Core 4 Server and get the same result. I have even tried specifying the port number in the code eg:
("jdbc:mysql://22.214.171.124:3306/mysql", "user", "pasword");
and allowing the port number in SeLinux.
Can anyone help me with this problem, I'm not really sure where the problem lies. It could be in the code as I'm new to connecting to MySQL with Java, or whether it is a firewall problem on the server.
Please help, cheers.
Last Post: 05-13-2005, 07:46 AM
By snowstorm in forum Java
Last Post: 05-04-2005, 02:01 PM
By Rob Abbe in forum Talk to the Editors
Last Post: 01-13-2003, 03:57 PM
By Mike Tsakiris in forum .NET
Last Post: 10-04-2002, 06:32 PM
By JJ in forum Enterprise
Last Post: 07-06-2000, 05:50 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL