fix bugs and add test of mysql

connect mysql and show a demo exchange between client and server.