外键约束求助
我在《深入浅出MYSQL数据库开发、优化与管理维护》一书中照着抄了一段代码,可是提示出错,怎么找也没找到错误原因,还请各位高手不吝赐教!
书本上抄的代码是:create table city(city_id smallint unsigned not null auto_increment,city varchar(50) not null,country_id smallint unsigned not null,last_update timestamp not null default current_timestamp on update current_timestamp,primary key(city_id),key idx_fk_country_id(country_id),constraint 'fk_city_country' foreign key(country_id) references country(country_id) on delete restrict on update cascade)engine=innodb default charset=utf8;
错误提示:error 1064(42000):you have an error in your sql syntax;check the manual that corresponds to your mysql server version for the right syntax to use near ''fk_city_country' foreign key(country_id) references country(country_id) on dele' at line 1
请各位高手帮我看看错误出在哪儿,谢谢了!