The binary protocol for MySQL is not, as I recall, particularly idiosyncratic. It's mostly a vehicle for asking the server to parse a text-based query, return a handle, and bind variables to executions of that query (when I implemented it, MySQL didn't even seem to use all the functionality of the protocol).