mysql在执行:source dump.sql,
导入中途出现乱码,并且断开连接。
ERROR:
Can't connect to the server
实际上是编码问题:
dump.sql字符编码为utf8,msql如下:
+--------------------------+--------------------------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------------------------+
| character_set_client | gbk |
| character_set_connection | gbk |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
通过设置my.ini,见JDBC查询条件中包含中文,无查询结果(编码问题),统一编码为utf8。