数据库在替换时出现了乱码,当时没发现,一段时间以后才发现,可是之前的原数据已经没了,不知道还能恢复处理吗?求各位大侠帮帮忙,
解决方案 »
- centos安装mysql最后一步不行了。。
- 请教字符转字段,交叉查询~
- mysql用myphpadmin到数据库服务器乱码
- 我想指定mysql的列值默认为空字符串
- 请大虾帮我把这个SQLSERVER的函数改成MYSQL的。
- postgres执行语句错误,请高手指点.
- 在MySQL数据库建表中为什么报错?帮帮忙啊!急!!
- mysql4.1中文问题。欢迎各位朋友来谈谈你们的看法!
- 一个线程执行mysql_store_result得到的MYSQL_RES,可以传递给另一个线程处理,并让其用free_result释放么?
- ibdata1丢失,怎么恢复,能恢复数据结构就行了
- 关于mysql群集费用问题
- mysql缓存读取
MySQL 中文显示乱码
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4317 to server version: 5.0.18-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> set names 'gbk';
Query OK, 0 rows affected (0.00 sec)mysql> use cnymys;
Database changedmysql> select * from dg_admin;
+----+----------+----------+------------------------+--------------+------------
---+-------------+------------+
| id | username | realname | pwd | departmentid | department
| mobile | addtime |
+----+----------+----------+------------------------+--------------+------------
---+-------------+------------+
| 2 | cn???? | ???í?± | BV1GWURcTUFcc913bcf7ef | 2 | ????
| 15910178940 | 1235031169 |
| 3 | test | ???? | CAhQCFcC965eb72c92 | 3 | ???¨???í?
± | 15910178941 | 1235031638 |
+----+----------+----------+------------------------+--------------+------------
---+-------------+------------+
2 rows in set (0.03 sec)mysql> set names 'gb2312';
Query OK, 0 rows affected (0.00 sec)mysql> select * from dg_admin;
+----+----------+----------+------------------------+--------------+------------
---+-------------+------------+
| id | username | realname | pwd | departmentid | department
| mobile | addtime |
+----+----------+----------+------------------------+--------------+------------
---+-------------+------------+
| 2 | cn???? | ???í?± | BV1GWURcTUFcc913bcf7ef | 2 | ????
| 15910178940 | 1235031169 |
| 3 | test | ???? | CAhQCFcC965eb72c92 | 3 | ???¨???í?
± | 15910178941 | 1235031638 |
+----+----------+----------+------------------------+--------------+------------
---+-------------+------------+
2 rows in set (0.02 sec)mysql> set names 'utf8';
Query OK, 0 rows affected (0.00 sec)mysql> select * from dg_admin;
+----+------------+--------------+------------------------+--------------+------
----------------+-------------+------------+
| id | username | realname | pwd | departmentid | depar
tment | mobile | addtime |
+----+------------+--------------+------------------------+--------------+------
----------------+-------------+------------+
| 2 | cn脪脢脙脡 | 鹿脺脌铆脭卤 | BV1GWURcTUFcc913bcf7ef |
2 | 脧碌脥鲁 | 15910178940 | 1235031169 |
| 3 | test | 虏芒脢脭 | CAhQCFcC965eb72c92 | 3 |
脝脮脥篓鹿脺脌铆脭卤 | 15910178941 | 1235031638 |
+----+------------+--------------+------------------------+--------------+------
----------------+-------------+------------+
2 rows in set (0.00 sec)mysql> show variables like 'collation_%';
+----------------------+-------------------+
| Variable_name | Value |
+----------------------+-------------------+
| collation_connection | utf8_general_ci |
| collation_database | latin1_swedish_ci |
| collation_server | utf8_general_ci |
+----------------------+-------------------+
3 rows in set (0.00 sec)mysql> show variables like 'character_set_%';
+--------------------------+---------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | D:\iisSrv\mysql\share\charsets\ |
+--------------------------+---------------------------------+
7 rows in set (0.00 sec)mysql>
2 | 脧碌脥鲁 | 15910178940 | 1235031169 |
| 3 | test | 虏芒脢脭 | CAhQCFcC965eb72c92 | 3 |
脝脮脥篓鹿脺脌铆脭卤 | 15910178941 | 1235031638 |应是utf-8的,mysql> show variables like 'collation_%';
+----------------------+-------------------+
| Variable_name | Value |
+----------------------+-------------------+
| collation_connection | utf8_general_ci |
| collation_database | latin1_swedish_ci |
| collation_server | utf8_general_ci |
+----------------------+-------------------+
3 rows in set (0.00 sec)mysql> show variables like 'character_set_%';
+--------------------------+---------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | D:\iisSrv\mysql\share\charsets\ |
+--------------------------+---------------------------------+
7 rows in set (0.00 sec)