0

I am trying to write a program that can access my database from a remote computer and change it. How can I figure out the url of my database? according to my source it should be something like this

jdbc:mysql://host_name:port/dbname

Thanks for your help.

3
Contributors
9
Replies
10
Views
5 Years
Discussion Span
Last Post by sirlink99
0

This may seem a bit obvious, but ask your web host.
Most have a page in your control panel that tells you the exact answer.

0

I have emailed my web host, and they have not replied yet. If anyone has any idea about where to look in the cpanel then that would be great to know. I have tried finding it in phpMyAdmin, but I couldn't find it.


thanks for any help.

0

If your web host is any good chances are that you won't be able to access your database from the outside.
In shared servers mysql is usually ocnfigured to respond only to requests from the local machine, for example from the webserver which runs phpMyAdmin.
Try to access your database with the mysql command line client:

mysql -u<user> -p<password> -h<host> <database-name>

If this works, enter those paremeters in your java connect string.

0

I cant seem to find the mySQL command line client. I tried to run this in the SQL script are, but it didn't work.

0

The mysql command line client is in the mysql server package which you can download from mysql.com. Install mysql on your local machine - even if you don't need the server, because the client makes use of some of the libraries -, and then you'll find it in the mysql/bin directory.

0

If your web host is any good chances are that you won't be able to access your database from the outside.
In shared servers mysql is usually ocnfigured to respond only to requests from the local machine, for example from the webserver which runs phpMyAdmin.
Try to access your database with the mysql command line client:

mysql -u<user> -p<password> -h<host> <database-name>

If this works, enter those paremeters in your java connect string.

I've got several hosts I use, and all let me configure remote access from my home PC. In most control panels, there is an option to allow remote access, usually requiring you to enter the isp's local router name (not your home router, the one you connect to from that). I can then use HeidiSQL (instead of phpmyadmin) from my laptop.

cPanel>Databases>Remote Access

also, to get the connection data,
cPanel > Databases> MySQL Databases allows me to add new databases and define username and password, and to see existing databases, usernames and passwords.

Some hosts only give you one database and usually give the connection strings to use in a help page - this may either be accessible from within your control panel (and can specifically display your connection strings), or from the host's own website (where they tend to give connection strings in a more general format and you have to edit them to include your details).

Edited by drjohn: n/a

0

I just got a reply, and they gave me the IP address. So you're saying I use that IP in my program to connect to and log in using a username and password created for the specific database?

What would the URL look like?

Edited by sirlink99: n/a

0

use the IP address as the url, plus username, password, port no. and database name.

All of this you can get from your website control panel - have you actually looked at that yet? It's where I always start when I need database details for a site.

0

I have looked at it. I have already made my databases, set up emails, and subdomains.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.