I have a database that's currently running on a 5.0.27 server. I want to move to a new 5.1.41 server.
I mysqldump'd all the files. When restoring, I get an error
ERROR 1062 (23000) at line 21: Duplicate entry 'weiÃ' for key 'title'
I've narrowed the failure down to this script, which I can run and it fails:
--
-- Table structure for table `word`
--
set names utf8;
DROP TABLE IF EXISTS `word`;
CREATE TABLE `word`
(
`wordid` int (10) unsigned NOT NULL auto_increment,
`title` char (50) NOT NULL default '',
PRIMARY KEY (`wordid`),
UNIQUE KEY `title` (`title`)
) ENGINE=MyISAM AUTO_INCREMENT=280707 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
--
-- Dumping data for table `word`
--
LOCK TABLES `word` WRITE;
INSERT INTO `word` VALUES
(198036,'weis'),
(241473, unhex('776569C39F'));
UNLOCK TABLES;
EDIT - changed to UNHEX.
I've checked and rechecked all the charset and collation variables between the two servers, and they look identical. Even if they weren't, I'm specifying the collation myself.
Any clues as to what I'm doing wrong here?
EDIT: here's the command I'm using to dump the database:
mysqldump --add-drop-table --add-locks --disable-keys --lock-tables --quick -uusername -ppassword database > filename
and to load
mysql -D$MYSQL_DB -u$MYSQL_USER -p$MYSQL_PASSWD < filename
How can I check the collations for the client connections?