1、新建 test_data1 数据库
2、在test_data1数据库中创建student表CREATE TABLE `student` ( `id` int(10) unsigne颊俄岿髭d NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `age` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3、在test_data1数据库中创建class表CREATE TABLE `clas衡痕贤伎s` ( `id` int(10) unsigned 绿覆冗猩NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4、新建test_data2数据库,并首疏扌熘创建student表,但结构设计id和score,class表则不创建CREATE TABLE `student` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `score` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
5、结构同步,将数据库test_data1库中的结构同步到test_data2数据库中
6、查看效果,结果是将test_data2中的student表结构同步成了test_data1库中student的表结构,并且将class表也同步到了test_data2库中
7、向test_data1库中student表中插入数据
8、向test_data2库中student表中插入数据
9、同步数据
10、查看效果