HELP! I cannot restore dumped data correctly on mysql version 4.1.11.
Posted by: minghao bao
Date: June 04, 2005 06:41PM

I get SOME strange Chinese characters while restoring backuped sql file. Please help me.

1. For system upgrade, I backup all the database using:

mysqldump -p somedatabse>backup.sql

2. After reinstall mysql(still the same version, 4.1.11), I restore the database using:

mysql -p --force <backup.sql

3. now, I got some strange Chinese chatacters like this:

随机条目 changed to 隿机濡目
图像列表 changed to 图僿列表
对话页 changed to 对诿页
电话 changed to 电诿
......

Some information:

* software versions

Redhat Fedora Core 3
MySQL 4.1.11
PHP 5.0.4 (apache2handler)
MediaWiki 1.4.4

* show variables like 'char%';

character_set_client latin1
character_set_connection latin1
character_set_database latin1
character_set_results latin1
character_set_server latin1
character_set_system utf8

* part of backup.sql

-- MySQL dump 10.9
--
-- Host: localhost Database: wikilib
-- ------------------------------------------------------
-- Server version 4.1.11

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Current Database: `wikilib`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `wikilib` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */;

USE `wikilib`;
--
-- Table structure for table `recentchanges`
--

DROP TABLE IF EXISTS `recentchanges`;
CREATE TABLE `recentchanges` (
`rc_id` int(8) NOT NULL auto_increment,
`rc_timestamp` varchar(14) character set latin1 collate latin1_bin NOT NULL default '',
`rc_cur_time` varchar(14) character set latin1 collate latin1_bin NOT NULL default '',
`rc_user` int(10) unsigned NOT NULL default '0',
`rc_user_text` varchar(255) character set latin1 collate latin1_bin NOT NULL default '',
`rc_namespace` tinyint(3) NOT NULL default '0',
`rc_title` varchar(255) character set latin1 collate latin1_bin NOT NULL default '',
`rc_comment` varchar(255) character set latin1 collate latin1_bin NOT NULL default '',
`rc_minor` tinyint(3) unsigned NOT NULL default '0',
`rc_bot` tinyint(3) unsigned NOT NULL default '0',
`rc_new` tinyint(3) unsigned NOT NULL default '0',
`rc_cur_id` int(10) unsigned NOT NULL default '0',
`rc_this_oldid` int(10) unsigned NOT NULL default '0',
`rc_last_oldid` int(10) unsigned NOT NULL default '0',
`rc_type` tinyint(3) unsigned NOT NULL default '0',
`rc_moved_to_ns` tinyint(3) unsigned NOT NULL default '0',
`rc_moved_to_title` varchar(255) character set latin1 collate latin1_bin NOT NULL default '',
`rc_patrolled` tinyint(3) unsigned NOT NULL default '0',
`rc_ip` varchar(15) NOT NULL default '',
PRIMARY KEY (`rc_id`),
KEY `rc_timestamp` (`rc_timestamp`),
KEY `rc_namespace_title` (`rc_namespace`,`rc_title`),
KEY `rc_cur_id` (`rc_cur_id`),
KEY `new_name_timestamp` (`rc_new`,`rc_namespace`,`rc_timestamp`),
KEY `rc_ip` (`rc_ip`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `recentchanges`
--


/*!40000 ALTER TABLE `recentchanges` DISABLE KEYS */;
LOCK TABLES `recentchanges` WRITE;
INSERT INTO `recentchanges` VALUES (171038,'20050601054519','20050601063721',153,'Dingfei916',11,'生活专题','',0,0,1,92562,400358,0,1,0,'',0,''),(171037,'20050601020053','20050601020053',2,'Bob',0,'美国之音','/* �� */',0,0,0,49645,0,400357,0,0,'',0,''),
...



Edited 1 time(s). Last edit at 06/04/2005 07:01PM by minghao bao.

Options: ReplyQuote


Subject
Views
Written By
Posted
HELP! I cannot restore dumped data correctly on mysql version 4.1.11.
2653
June 04, 2005 06:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.