mysql 1280_为什么Mysql给我错误1280“错误的索引”

任何人都可以解释为什么Mysql给我错误1280(“fk_chart_aid_aid’的错误索引”)错误,当我尝试创建“帐户图表”表时.我在这里完全糊涂了.我该如何解决这个问题,以便创建表格? “ACCOUNT”表已存在于数据库中并且其中包含数据.

谢谢您的帮助.

MYSQL Server版本:5.1.54

账户表:

DROP TABLE IF EXISTS `rst`.`acctg_chart_of_accounts` ;

CREATE TABLE IF NOT EXISTS `rst`.`acctg_chart_of_accounts` (

`acctg_chart_of_accounts_id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,

`account_id` INT UNSIGNED NOT NULL ,

`account_nbr` VARCHAR(45) NULL ,

`description` VARCHAR(45) NULL ,

`account_type` INT UNSIGNED NULL ,

`commissionable` TINYINT UNSIGNED NULL ,

`hidden` TINYINT UNSIGNED NULL ,

`deduct_balance_from_owner_check` TINYINT UNSIGNED NULL ,

PRIMARY KEY (`acctg_chart_of_accounts_id`) ,

CONSTRAINT `fk_chart_aid_aid`

FOREIGN KEY (`account_id` )

REFERENCES `rst`.`account` (`account_id` )

ON DELETE CASCADE

ON UPDATE CASCADE)

ENGINE = InnoDB;

CREATE INDEX `fk_chart_aid_aid` ON `rst`.`acctg_chart_of_accounts` (`account_id` ASC) ;

帐户表正在参考:

CREATE TABLE IF NOT EXISTS `account` (

`account_id` int(10) unsigned NOT NULL AUTO_INCREMENT,

`account_status_id` int(10) unsigned NOT NULL,

`company_name` varchar(155) DEFAULT NULL,

`address1` varchar(155) DEFAULT NULL,

`address2` varchar(155) DEFAULT NULL,

`city` varchar(155) DEFAULT NULL,

`state` varchar(155) DEFAULT NULL,

`zip` varchar(45) DEFAULT NULL,

`country` varchar(255) DEFAULT NULL,

`work_phone` varchar(45) DEFAULT NULL,

`mobile_phone` varchar(45) DEFAULT NULL,

`time_zone` varchar(45) DEFAULT NULL,

`subdomain` varchar(155) DEFAULT NULL,

`cname_URL` varchar(255) DEFAULT NULL,

`promotion_code` varchar(45) DEFAULT NULL,

`can_we_contact_you` tinyint(4) DEFAULT NULL COMMENT '0=false, 1=true',

`units_managed_nbr` varchar(10) DEFAULT NULL,

`a_hear_about_us_list_id` tinyint(3) unsigned DEFAULT NULL COMMENT 'populated from dropdown list.',

`receive_special_offers` tinyint(4) DEFAULT NULL,

`receive_announcements` tinyint(4) DEFAULT NULL,

`receive_newsletter` tinyint(4) DEFAULT NULL,

`create_ts` timestamp NULL DEFAULT NULL,

`expires` timestamp NULL DEFAULT NULL,

`storage_capacity` varchar(255) DEFAULT NULL COMMENT '1073741824 = 1GB',

`logo` varchar(455) DEFAULT NULL,

`max_active_connections` int(11) DEFAULT '3',

`_product_id` int(11) DEFAULT NULL,

`report_footer` varchar(455) DEFAULT NULL,

`welcome_dialog` tinyint(4) DEFAULT '1',

`ARB_subscription_id` int(11) DEFAULT NULL,

`trashbin` tinyint(4) NOT NULL DEFAULT '1',

PRIMARY KEY (`account_id`),

KEY `fk_account_account_status_id` (`account_status_id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=58 ;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值