电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

解决由于操作不当出现的ERROR 1005错误

4页
  • 卖家[上传人]:m****
  • 文档编号:57383333
  • 上传时间:2018-10-21
  • 文档格式:DOCX
  • 文档大小:15.20KB
  • / 4 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 1、解决由于操作不当出现的解决由于操作不当出现的 ERRORERROR 10051005 错误错误在使用 MySQL 的时候,在操作不当时,很容易出现 ERROR 1005 (HY000): Cant create table 这类错误。很多站长朋友可能需要排查很久才会找到问题的原因其实很简单,希望这篇文章可以对站长朋友以及 Mysql 初学者一点帮助。MySQL 官方提供的问题原因:在信息中有一组【LATEST FOREIGN KEY ERROR】会有最近错误的详细描述和解决办法。Cannot find an index in the referenced table where the referenced columns appear as the first columns, or column types in the table and the referenced table do not match for constraint.(译:不能在“被 reference 的表”里找到包含“被 reference 字段”的索引,或者是两个关联字段类型不匹配)天地棋牌 http:/

      2、以下介绍两个示例:示例一:程序代码create table booktype(btid int(5) unsigned zerofill auto_increment not null primary key,btname varchar(100) not null unique,btnote text);create table books(bid int(5) unsigned zerofill auto_increment not null primary key,bname char(30) not null,isbn char(50) not null,author char(30) not null,press text,summary text,bcount int not null default 0,btid int,foreign key(btid) references booktype(btid);出现的报错:程序代码ERROR 1005 (HY000): Cant create table .ookdataooks.frm (errno: 150)主要问题以及

      3、解决办法是:foreign key(btid) references booktype(btid) 中 books 表的 btid 是 int 和 booktype表中的 btid 设置的关联字段类型不匹配,books 表中 btid 改正成:btid int(5) unsigned zerofill ,就不会报错了,创建表和修改表地时候常常一步小小就忘记了这个.示例二:MySQL 里创建外键时(Alter table xxx add constraint fk_xxx foreign key),提示错误,但只提示很简单的信息:ERROR 1005 (HY000): Cant create table .env_mon#sql-698_6.frm (errno: 150)。根本起不到解决问题的作用。drop table if exists products;create table products(id int not null auto_increment,title varchar(100) not null,description text not null,image_url

      4、 varchar(200) not null,price decimal(10,2) not null,date_available datetime not null,primary key(id)type=innodb;drop table if exists line_items;create table line_items(id int not null auto_increment,product_id int not null,quantity int not null default 0,unit_price decimal(10,2) not null,constraint fk_items_product foreign key (product_id) references producets(id),index(product_id)primary key(id)type=innodb;出现的报错:ERROR 1005: Cant create table主要问题以及解决办法是:1,MySQL 支持外键约束,并提供与其它 DB 相同的功能,但表类型必须为 InnoDB2、建外键的表的那个列要加上 index。638 棋牌 http:/

      《解决由于操作不当出现的ERROR 1005错误》由会员m****分享,可在线阅读,更多相关《解决由于操作不当出现的ERROR 1005错误》请在金锄头文库上搜索。

      点击阅读更多内容
    最新标签
    信息化课堂中的合作学习结业作业七年级语文 发车时刻表 长途客运 入党志愿书填写模板精品 庆祝建党101周年多体裁诗歌朗诵素材汇编10篇唯一微庆祝 智能家居系统本科论文 心得感悟 雁楠中学 20230513224122 2022 公安主题党日 部编版四年级第三单元综合性学习课件 机关事务中心2022年全面依法治区工作总结及来年工作安排 入党积极分子自我推荐 世界水日ppt 关于构建更高水平的全民健身公共服务体系的意见 空气单元分析 哈里德课件 2022年乡村振兴驻村工作计划 空气教材分析 五年级下册科学教材分析 退役军人事务局季度工作总结 集装箱房合同 2021年财务报表 2022年继续教育公需课 2022年公需课 2022年日历每月一张 名词性从句在写作中的应用 局域网技术与局域网组建 施工网格 薪资体系 运维实施方案 硫酸安全技术 柔韧训练 既有居住建筑节能改造技术规程 建筑工地疫情防控 大型工程技术风险 磷酸二氢钾 2022年小学三年级语文下册教学总结例文 少儿美术-小花 2022年环保倡议书模板六篇 2022年监理辞职报告精选 2022年畅想未来记叙文精品 企业信息化建设与管理课程实验指导书范本 草房子读后感-第1篇 小数乘整数教学PPT课件人教版五年级数学上册 2022年教师个人工作计划范本-工作计划 国学小名士经典诵读电视大赛观后感诵读经典传承美德 医疗质量管理制度 2 2022年小学体育教师学期工作总结
    关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
    手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
    ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.