MYSQL mysiam表不支持外键,用ERWIN建模时该怎么表示一对一,一对多,多对多关系呢?
另外,没有了外键,该怎么保证数据一致性呢?
请各位大哥指点一二~~

解决方案 »

  1.   

    没有办法,或者你用innodb存储引擎。或者你放弃外键约束。
      

  2.   


    那ER图该怎么画啊?
    画ER图时ERwin自动生成外键
    不能画ER图,我怕设计的数据库出现什么问题
      

  3.   

    可以画ER图啊,你生成的create table 语句可以使用,MyISAM会自动忽略掉foregin key的
      

  4.   

    文档中已经解释了,其它引擎会忽略掉InnoDB tables support checking of foreign key constraints. See Section 13.6, “The InnoDB Storage Engine”. Note that the FOREIGN KEY syntax in InnoDB is more restrictive than the syntax presented for the CREATE TABLE statement at the beginning of this section: The columns of the referenced table must always be explicitly named. InnoDB supports both ON DELETE and ON UPDATE actions on foreign keys. For the precise syntax, see Section 13.6.4.4, “FOREIGN KEY Constraints”. For other storage engines, MySQL Server parses and ignores the FOREIGN KEY and REFERENCES syntax in CREATE TABLE statements. The CHECK clause is parsed but ignored by all storage engines. See Section 1.7.5.4, “Foreign Keys”.