views:

182

answers:

2

I am writing a code that access a MySql database. The database is on a server that we access through our web-browser

Let's say,

URL: http://cbm.goo.com/phpMyAdmin

Username: username

Password: password

The above username and password are used to access the MySql database through a web-browser.

Q1. What would be database url of the database to be used in JDBC programming?

I tried the following url but it didn't work

jdbc:mysql://cbm.goo.com:3306/scores?user=username&password=password

========================== Edited ===================================

I am getting the following error:

Communications link failure

The last packet successfully received from the server was 1,267,163,244,109 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.

+1  A: 

Using JDBC with MySQL quick start guide

twodayslate
-1 Read the question carefully... the question is focused on phpmyadmin
Yatendra Goel
You want to connect to the database with JDBC - phpmyadmin is just a web front-end. Connect to the database directly.
twodayslate
lol... very-2 thanks for your answer lol...
Yatendra Goel
+1 because you are right :)
bunn_online
+1 for receiving -1 for ignoring phpmyadmin in this context ;)
sfussenegger
+2  A: 

Check that your internet connection is not going through some sort of firewall that is blocking access to port 3306.

Some companies have restricitions set on which ports can be used. Web servers use port 80 which is usually opened up to allow web browsing. Your MySQL server is using port 3306.

bunn_online
accepted answer, but no up vote?
bunn_online