Possible new connection type: Web Proxy

[expired user #9089]'s profile image [expired user #9089] posted 9 years ago in Creating a connection Permalink
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.
[expired user #9089]'s profile image [expired user #9089] posted 9 years ago Permalink
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's profile image kalvaro posted 9 years ago Permalink
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.
[expired user #9089]'s profile image [expired user #9089] posted 9 years ago Permalink

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's profile image kalvaro posted 9 years ago Permalink
Alright, I suppose tunnelling is just an expression and not the usual computer networks meaning.
[expired user #9089]'s profile image [expired user #9089] posted 9 years ago Permalink
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's profile image kalvaro posted 9 years ago Permalink
So you do have HTTPS enabled in your hosting account? I don't need to remind you that http:// protocol is not encrypted.
[expired user #9089]'s profile image [expired user #9089] posted 9 years ago Permalink
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's profile image kalvaro posted 9 years ago Permalink
If you don't need encryption, why is SSH tunnelling a must?

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