“重复检查约束名称"无重复 [英] "Duplicate check constraint name" without duplicate

查看:152
本文介绍了“重复检查约束名称"无重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一个大型 MySQL 架构导入一个空数据库.

I'm trying to import a big MySQL schema into an empty database.

我有这个错误:

ERROR 3822 (HY000) at line 2682: Duplicate check constraint name 'notifications_chk_1'.

但不存在约束notifications_chk_1.

  • 检查空数据库:它是 100% 空的.

  • Checked the empty database : it's 100% empty.

查看mysql文件:notifications_chk_1只出现一次:

Checked the mysql file : notifications_chk_1 appears only once:

$ grep "notifications_chk_1" qs_remote_multi.sql 
  CONSTRAINT `notifications_chk_1` CHECK (json_valid(`related`))

  • 发生错误后检查数据库,不存在notifications_chk_1:
  • MySQL [(none)]> select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where CONSTRAINT_TYPE = 'CHECK' AND CONSTRAINT_NAME LIKE "notif%";
    Empty set (0.006 sec)
    

    Mysqldump 版本(来源):MySQL dump 10.19 Distrib 10.3.31-MariaDB, for debian-linux-gnu (x86_64)

    Mysqldump version (source): MySQL dump 10.19 Distrib 10.3.31-MariaDB, for debian-linux-gnu (x86_64)

    Mysql 版本(目标):mysql Ver 15.1 Distrib 10.3.32-MariaDB,用于 osx10.15 (x86_64) 使用 readline 5.1

    Mysql version (target): mysql Ver 15.1 Distrib 10.3.32-MariaDB, for osx10.15 (x86_64) using readline 5.1

    有什么想法吗?

    推荐答案

    通过执行 MariaDB 全新安装(擦除所有数据)来修复它.

    Fixed it by doing a MariaDB fresh install (erasing all data).

    这篇关于“重复检查约束名称"无重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆