我只是使用 MySQL mysqldump 工具来生成 DDL,这样我就可以在另一台机器上创建健全的数据库。当我尝试在目标机器上运行它时,我收到了这个错误:
脚本行:表中不存在 28 键列“friendPrimaryKeyInYour Phone”
运行此语句:
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `friend` (
`id` bigint(20) unsigned NOT NULL,
`dependentId` bigint(20) unsigned NOT NULL,
`friendPrimaryKeyInYourPhone` int(10) unsigned NOT NULL,
`friendNameInYourPhone` varchar(45) NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`,`friendPrimaryKeyInYourPhone`) USING BTREE,
UNIQUE KEY `idx_dependendentId_phonePk` (`dependentId`,`friendPrimaryKeyInYour
Phone`),
KEY `idx_phonePk` (`friendPrimaryKeyInYourPhone`),
KEY `idx_dependentId` (`dependentId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
知道 MySQL 如何生成此 DDL 并在几秒钟后认为它无效吗?