You can do this in 2 steps, first invoke your mysql command and connect it to a named pipe
socat PIPE:/tmp/mysql_pipe EXEC:"mysql"
Then connect tcp clients to that named pipe
socat TCP4-LISTEN:31337,fork PIPE:/tmp/mysql_pipe