centos7.5 删除表空间文件失败

问题:

mysql> alter table country discard tablespace;
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails ()

原因:

在MySQL在InnoDB中设置了foreign key关联,造成无法更新或删除数据。可以通过设置FOREIGN_KEY_CHECKS变量来避免这种情况。

解决方法:

mysql> SET FOREIGN_KEY_CHECKS = 0;
Query OK, 0 rows affected (0.00 sec) mysql> alter table country discard tablespace;
Query OK, 0 rows affected (0.01 sec) mysql> SET FOREIGN_KEY_CHECKS = 1;
Query OK, 0 rows affected (0.00 sec)

ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails ()的更多相关文章

  1. MySQL:ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails

    MySQL在删除一张表时出现 ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fa ...

  2. ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails

    mysql 删除表时提示有外键 mysql> drop tables auth_group;ERROR 1217 (23000): Cannot delete or update a paren ...

  3. mysql ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constrain fails

    ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constrain fails. 可能是MySQL在In ...

  4. 【转】表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理

    转载地址:http://lijiejava.iteye.com/blog/790478 有两张表,结构如下: t_item:                          t_bid: id    ...

  5. 表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理

    有两张表,结构如下: t_item:                          t_bid: id        int                     id        int n ...

  6. Mysql - 删除表时出现: Cannot delete or update a parent row: a foreign key constraint fails

    现象 MySQL在删除一张表时出现 ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint ...

  7. MySQL主从复制中断,报“Error on master: message (format)='Cannot delete or update a parent row: a foreign key constraint fails' error code=1217” 错误

    前几天,发现从库挂了,具体报错信息如下: 分析思路 1. 因为我采用的是选择性复制,只针对以下几个库进行复制: card,upay,deal,monitor,collect.所以,不太可能出现对于sa ...

  8. 【转】 #1451 - Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法

    转载地址:http://blog.csdn.net/donglynn/article/details/17056099 错误 SQL 查询: DELETE FROM `zmax_lang` WHERE ...

  9. Mysql之1451 - Cannot delete or update a parent row: a foreign key constraint fails...解决办法记录

    今天使用delete语句删除一张表中的一条信息时,提示了这么一个错误:1451 - Cannot delete or update a parent row: a foreign key constr ...

随机推荐

  1. Mesos和Docker的集成

    摘要: 众所周知,Mesos全面支持Docker.但是这意味着什么呢?在命令行里运行docker run...就可以使用Docker了.还需要做什么?让我们一起研究下Mesos的高级特性——和Dock ...

  2. word2vec:基本的安装及使用简介

    官方word2vec的github下载地址:https://github.com/svn2github/word2vec 环境,linux-ubuntu-14.04LST,安装好git, gcc版本4 ...

  3. 第六天 py 加法练习

    其实就是while的用法!   该看第65 啦

  4. rails 杂记 - render and layout

    官方文档:http://guides.rubyonrails.org/layouts_and_rendering.html 渲染 view 渲染 html.rb 与相应的 action control ...

  5. 7 ArcMap能复制,不能粘贴

    1:能复制不能粘贴 有时候在编辑数据的时候,需要在不同的shp层之间操作,往往有时候可以复制,但是粘贴那一项是灰色的 解决办法1:打开ArcScene,在关掉即可 解决办法2:如果是在编辑状态下,有时 ...

  6. 记一次maven的包冲突经历

    上周工作遇到一个特别棘手的bug,花了我一天时间去搞. 事情是这样的,打包那边的同事过来跟我说我的项目无法运行自动打包,卡在maven package上面,报错为:[error]未经检查的异常,需要捕 ...

  7. git push fatal: The remote end hung up unexpectedly

    git push fatal: The remote end hung up unexpectedly git config http.postBuffer git gc --aggressive 不 ...

  8. HTML、CSS知识点,面试开发都会需要--No.6 设置背景

    No.6 设置背景 1.background (1)如何设置背景:背景可通过color.image.gradient渐变或者组合方法设置. (2)background-color:颜色格式可以是十六进 ...

  9. HTML经典模板总结(地址)

    HTML经典模板总结 地址:http://download.csdn.net/tag/html%E6%A8%A1%E6%9D%BF?from=singlemessage

  10. linux 系统下apache 找不到apxs 文件

    yum install httpd-devel