我建立了一个数据库,采用默认字符集为utf8,安装utf8简体中文版的discuz论坛,想倒入原来别的论坛数据到这个新论坛,但是在cmd里面使用mysql查询的标里面的中文字符串为问号,看看连接的字符集为latin1,也就是names被设为latin1,于是我使用
set name utf8,
结果查询出来的结果为乱码,因此导出的中文同样为乱码,
mysql> use discuz;
Database changed
mysql> select * from cdb_members;
+-----+----------+----------------------------------+
| uid | username | password |
+-----+----------+----------------------------------+
| 1 | tom | 23be0677c8194dd62ab3 |
| 2 | ?? | e10adc3949b6e057f203e |
+-----+----------+----------------------------------+
2 rows in set (0.00 sec)
mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from cdb_members;
+-----+----------+----------------------------------+
| uid | username | password |
+-----+----------+----------------------------------+
| 1 | tom | 23be0677c8194dd62ab3 |
| 2 | 娴嬭瘯 | e10adc3949b6e057f203e |
+-----+----------+----------------------------------+
请问有没有办法解决?