I have a URL from frontend access to the database.
Is this enough information to connect programmatically to the database? I’m trying with things like this (php):
<?php
$username = "xxx";
$password = "xxx";
$hostname = "db.blabla.com";
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";
?>
And it seems at least to recognize that the host exists, but it says timed out connection.
It seems to use tcp://
I also did a random test with java and jdbc:mysql:// but same problem.
I don’t have an idea what the protocol and port are supposed to be… is it possible to guess it, maybe trial and error…?
Thanks
Edit: Could file ending .do for server files give a hint for the type of database used?
Edit 2: This is not a php question, I just put php example. It’s about how (if possible) generally connect.
It isn’t enough information. You have no idea what the backend is doing. There might be a database, there might not be. It might be MySQL, it might not be. It might be on the same host, it might not be. It might have the same passwords as the front end, it shouldn’t.
Any DBA worth his salt will have configured the database so only the host running the front end (and maybe a few other authorised hosts) can access it. Any decent network admin will have ensured that those hosts are the only ones that the firewall will allow access to the database server as well.