Possible new connection type: Web Proxy

heyesr posted 4 years ago in Creating a connection
Hi,

I've come to like using HeidiSQL over phpMyAdmin - thanks for making it (and for making it free!). I currently host my website with 1and1 which don't allow tunneling and so I understand that because of that, Heidi won't work with 1and1 - so I'm still using phpMyAdmin for that.

Bummer.

But a possible idea that may or may not have merit: Would using a HTTP proxy webpage be feasible? ie Heidi installed on my computer posts to a page sitting on my 1and1 webspace that simply passes the SQL queries on to MySQL.

It might be the fastest of methods to talk to MySQL but it would at least allow it to work (perhaps with a limited feature set). I imagine the script on the server would be simple enough - simply take the POSTed SQL query, run it, and return the results:

<?php
$host = 'localhost';
$user = 'root';
$pass = '';
$dbas = 'mysql';
$sql = $_POST['sql'];

$conn = mysql_pconnect($host, $user, $pass);
mysql_select_db($dbas);

$result = mysql_query($sql);

while ($row = mysql_fetch_array($result)) {
foreach ($row as $k => $v) {
echo $k . '=' . $v . ',';
}

echo "\r\n";
}
?>

Or something like that. Making it less verbose (or binary perhaps?) might make it little bit quicker.
heyesr posted 4 years ago
Hi (again),

Another benefit might be in use cases where the MySQL server is behind a firewall. Instead of opening a port on the firewall to allow you to remotely administer MySQL you just install the webproxy script on your web server and talk to that.

I'd imagine it to be common for port 80 to be already open.
kalvaro posted 4 years ago
I'm not a HeidiSQL developer but I have the gut feeling that tweaking HeidiSQL to work over a stateless protocol such as HTTP would imply quite a rewrite.

Whatever, I don't understand your reference to tunnelling. If you mean encryption, the HTTP client would require HTTPS (is that available in your hosting plan?). If you mean that you cannot use a regular MySQL client, it's simply because they don't want you to.

P.S. Please stop using the insecure and annoying to use legacy MySQL extension. It's been deprecated for many years and next major version (which is already beta) will no longer include it.
heyesr posted 4 years ago

Whatever, I don't understand your reference to tunnelling. If you mean encryption, the HTTP client would require HTTPS (is that available in your hosting plan?). If you mean that you cannot use a regular MySQL client, it's simply because they don't want you to.



They don't allow tunneling. So Heidi on my local PC can't connect to the 1and1 MySQL. But if Heidi could talk to a webpage - the webpage could quite happily give it the results.

P.S. Please stop using the insecure and annoying to use legacy MySQL extension. It's been deprecated for many years and next major version (which is already beta) will no longer include it.



I don't - it was just an example, as the older mysql client is burned into my memory.
kalvaro posted 4 years ago
Alright, I suppose tunnelling is just an expression and not the usual computer networks meaning.
heyesr posted 4 years ago
Hi,

I'm talking about SSH tunelling. The 1and1 shared hosting package doesn't permit it and MySQL is not available to the wider internet. so my local copy of Heidi can't access the 1and1 MySQL server. A web page intermediary would make it possible though.
kalvaro posted 4 years ago
So you do have HTTPS enabled in your hosting account? I don't need to remind you that http:// protocol is not encrypted.
heyesr posted 4 years ago
I don't need it to be. I just want to use Heidi to administer my database. I use phpMyAdmin to do it at the moment - that's not encrypted.
kalvaro posted 4 years ago
If you don't need encryption, why is SSH tunnelling a must?

Please login to leave a reply, or register at first.