原因:
mysql有字符集类型选择
在连接mysql的字符串中加CharSet=utf8转义一下就好了server =127.0.0.1;user =root;password =root;database =test;CharSet=utf8;