“重复检查约束名称"无重复

2022-01-15 00:00:00 import constraints mariadb mysql

我正在尝试将一个大型 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).

相关文章