[Help Request] MySQL Listen Server

Nemeses

Well-Known Member
Joined
Jul 15, 2010
Messages
223
Reaction score
1
Location
Durban
[c#, asp 4, .net]

Hey guys,

I am currently on a task to create a MySQL listen server.

What this basically needs to do is allow a SQL Client (Such as HeidiSQL) to connect to it, then it listens to the commands, and visually displays it.
So far, I've created the listening server to listen to a port, and then display any data coming into that port visually (I did this by creating a quick client to send data through the pord).

But, what I need to do now, is to actually allow my server to let SQL Clients connect, and make it look like its a legit server.

If any of you have experience in this, or would just like to help me debug this situation, please will you give me a helping hand.

And also, if you know me or read my posts, you will know that I will post the complete working code as open source once I've figured it out..
 
Last edited:
Defiantly helps, but, with that I basically need to use those algorithms to code the rest of the listening part of the server from scratch...

I guess my hopes of just routing the information are scrapped... Also hoping for a simple .dll reference seemed too good to be true anyway.

I will keep looking, though, to see if anyone has achieved this, in hopes to not subjugate me in re-inventing this wheel all alone.
Will update with relevant info.
 
Is there a reason why you need to do this?
Isnt there another way to achieve what you want
 
Cant you simply put your listening server on one port and then forward that same message on to the real mySQL port?

Are you trying to intercept communication for visual inspection?
 
Can't you just take the source for the real server and find the appropiate place to append the input to a file or something? Then just tail that file if you want it "live".
 
Is there a reason why you need to do this?
Isnt there another way to achieve what you want

That was my 1st choice. Does not work unfortunately..
And yes, thats basically what I want to do.


Can't you just take the source for the real server and find the appropiate place to append the input to a file or something? Then just tail that file if you want it "live".

There is no real 'open source' server which is in production (Unless my hours of searching is fruitless). And the Dev code that is out there still require me to play with the algorythms.


I basically want to do this:

(Any)[1]MySQL Client <--> [2]Router* <---INTERNET---> [3]Reciever* <--> [4]MySQL Server

*Applications I am in development with.

[1] and [2] are on the client machine,
while [3] is server side connecting to
[4] which can either be on the local machine with [3] or somewhere else..
 
so you want some sort of sql relay client/server thing so you dont have to open up your main production sql box to the interwebs?
 
Last edited:
theres something like

grant all privileges on db.* to 'username'@'ip' where password = 'pass';

in mysql, probably the same for mssql.

If your external facing ip is static on [2]Router. I see this as just as good as having some sort of relay. Just block everything except port 3306 on the firewall on the otherside as well as other ip ranges, apart from the one you are accessing from.

Otherwise take a look at netcat.

on [2]Router
nc -l -p 3306 -c "nc ip_of_[3]Reciever 3306"

on [3]Receiver
nc -l -p 3306 -c "nc ip_of_sql_server 3306"

or soemthing like that

OR!

you could look at using it in a ssh tunnel
 
Last edited:
That was my 1st choice. Does not work unfortunately..
And yes, thats basically what I want to do.




There is no real 'open source' server which is in production (Unless my hours of searching is fruitless). And the Dev code that is out there still require me to play with the algorythms.


I basically want to do this:

(Any)[1]MySQL Client <--> [2]Router* <---INTERNET---> [3]Reciever* <--> [4]MySQL Server

*Applications I am in development with.

[1] and [2] are on the client machine,
while [3] is server side connecting to
[4] which can either be on the local machine with [3] or somewhere else..

You can download the mysql "community server" source code. A full blown server would be overkill for your requirements. I though you maybe wanted it for training purposes or something. Would mysql proxy not be what you're looking for?

MySQL Proxy is a simple program that sits between your client and MySQL server(s) that can monitor, analyze or transform their communication. Its flexibility allows for a wide variety of uses, including load balancing; failover; query analysis; query filtering and modification; and many more.
http://dev.mysql.com/downloads/mysql-proxy/

To download the source just select "source code" as your platform. There's some guides out there on how to build it if you need.
 
You can download the mysql "community server" source code. A full blown server would be overkill for your requirements. I though you maybe wanted it for training purposes or something. Would mysql proxy not be what you're looking for?


http://dev.mysql.com/downloads/mysql-proxy/

To download the source just select "source code" as your platform. There's some guides out there on how to build it if you need.

Tried the SQLProxy, failed. I'm getting the source code, all I need to do is figure out how to accept a connection from a SQL Client. Thats all :)

@avert, I don't just want to stop other conenctions..
 
Top
Sign up to the MyBroadband newsletter
X