This, unfortunately, isn't going to work so easily...I really wish it did, but it won't.
The main problem is very close to what hoolio guessed at, the actual SELECT statement in MySQL comes only after the initial handshake, server welcome, client authentication, and subsequent information from the server about it's capabilities.
At the bottom is a link to the MySQL Server/Client Protocol wiki page. You are definitely headed down the right road, but you've got to convince the client that it is talking to a real MySQL server.
http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol