赞
踩
- <span style="font-family:Arial;font-size:12px;">mysql> show variables like '%char%';
- +--------------------------+---------------------------------------------------------+
- | Variable_name | Value |
- +--------------------------+---------------------------------------------------------+
- | character_set_client | utf8 |
- | character_set_connection | utf8 |
- | character_set_database | utf8 |
- | character_set_filesystem | binary |
- | character_set_results | utf8 |
- | character_set_server | utf8 |
- | character_set_system | utf8 </span>
<span style="font-family:Arial;font-size:12px;">并且确保了我的<span style="color:#ff0000;">数据库的表字符集为utf-8,但是导出的sql脚本中的中文却是乱码</span>。</span>
<span style="font-family:Arial;font-size:12px;">原因是<span style="background-color: rgb(255, 255, 255);"><span style="color:#ff0000;">输出的时候.sql脚本的编码格式是ANSI,是解析sql脚本编码格式不正确,并不是输出编码问题。</span></span></span>
<span style="font-family:Arial;font-size:12px;">解决方法:<span style="color:#ff0000;">用记事本或者notepad++等工具将编码格式转为utf-8即可。</span>(ps:记事本(另存为) notepad++在工具栏格式中设置)</span>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。