mysql ОШИБКА 1050 при восстановлении из mysql дампа в aws Аврора без сервера - PullRequest
0 голосов
/ 26 марта 2020

Я получаю ошибку при восстановлении данных из mysql dump в AWS aurora serverless.

ERROR 1050 (42S01) at line 4872: Table already exists

При просмотре mysql журналов в «разделе событий и журналов», подробности

InnoDB: Tablespace 'db1/table1' exists in the cache with id 6339
InnoDB: Freeing existing tablespace 'db1/table1' entry from the cache with id 6339 and will create new one with id 743
InnoDB: Load table 'db1/table1'  failed, the table has missing foreign key indexes. Turn off 'foreign_key_checks' and try again.
InnoDB: Cannot load table aviator_'db1/table1' from InnoDB internal data dictionary during drop database

проблемы с внешним ключом, я проверил, есть ли таблицы.

Моя схема table1 table в дампе. sql

 DROP TABLE IF EXISTS `table1`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `table1` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `agency_user_id` int(10) unsigned DEFAULT NULL,
  `advertiser_id` int(10) unsigned NOT NULL,
  `channel_id` bigint(20) unsigned NOT NULL,
  `campaign_id` int(10) unsigned NOT NULL,
  `email_id_csv` varchar(255) DEFAULT NULL,
  `email_id_cc_csv` varchar(255) DEFAULT NULL,
  `message` text,
  `attachment` varchar(255) DEFAULT NULL,
  `pdf_url` text,
  `excel_url` text,
  `email_html_url` varchar(255) DEFAULT NULL,
  `sent_status` enum('sent','marked-as-sent','marked-as-resent','saved') DEFAULT 'saved',
  `updated_at` timestamp NULL DEFAULT NULL,
  `ro_status` int(3) unsigned NOT NULL DEFAULT '2',
  `ro_operation` int(3) unsigned NOT NULL DEFAULT '1',
  `ro_lock_period` timestamp NULL DEFAULT NULL,
  `ro_sent_date` timestamp NULL DEFAULT NULL,
  `sky_edit_campaign_track_id` int(11) NOT NULL DEFAULT '-1',
  `seller_order_id` varchar(255) DEFAULT NULL,
  `buyer_order_id` varchar(255) DEFAULT NULL,
  `traffic_manager_order_id` varchar(255) DEFAULT NULL,
  `revision_number` double DEFAULT NULL,
  `initiated_by` enum('BUYER','SELLER') DEFAULT 'SELLER',
  `date_of_revision` datetime DEFAULT NULL,
  `order_status` enum('UNDER_REVIEW','CONFIRMED','WO_PENDING') DEFAULT NULL,
  `no_of_preempted_spots` int(11) DEFAULT NULL,
  `no_of_make_good_preempted_spots` int(11) DEFAULT NULL,
  `preempted_spots_value` double DEFAULT NULL,
  `preempted_spots_value_of_make_goods` int(11) DEFAULT NULL,
  `no_of_make_good_spots` int(11) DEFAULT NULL,
  `make_good_value` double DEFAULT NULL,
  `grp_shortfall` double DEFAULT NULL,
  `grp_shortfall_value` double DEFAULT NULL,
  `no_of_adu_spots` int(11) DEFAULT NULL,
  `adu_spots_grp` double DEFAULT NULL,
  `adu_spots_value` double DEFAULT NULL,
  `order_name` varchar(255) NOT NULL,
  `order_creation_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `estimate_number` varchar(255) DEFAULT NULL,
  `metric_name` varchar(10) DEFAULT NULL,
  `metric_unit` varchar(15) DEFAULT NULL,
  `proposal_id` int(11) DEFAULT NULL,
  `sky_external_campaign_input_id` bigint(20) DEFAULT NULL,
  `assigned_to_user_id` bigint(20) unsigned DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT '0',
  `sky_order_input_id` int(11) DEFAULT NULL,
  `preempted_spots_rating` double NOT NULL DEFAULT '0',
  `pre_approved_preempted_spots_rating` double NOT NULL DEFAULT '0',
  `need_buyer_approval_preempted_spots_rating` double NOT NULL DEFAULT '0',
  `pre_approved_make_good_spots_rating` double NOT NULL DEFAULT '0',
  `need_buyer_approval_make_good_spots_rating` double NOT NULL DEFAULT '0',
  `no_of_pre_approved_make_good_preempted_spots` int(11) NOT NULL DEFAULT '0',
  `no_of_need_buyer_approval_make_good_preempted_spots` int(11) NOT NULL DEFAULT '0',
  `no_of_pre_approved_make_good_spots` int(11) NOT NULL DEFAULT '0',
  `no_of_need_buyer_approval_make_good_spots` int(11) NOT NULL DEFAULT '0',
  `pre_approved_preempted_spots_value` double NOT NULL DEFAULT '0',
  `need_buyer_approval_preempted_spots_value` int(11) NOT NULL DEFAULT '0',
  `pre_approved_make_good_value` double NOT NULL DEFAULT '0',
  `need_buyer_approval_make_good_value` double NOT NULL DEFAULT '0',
  `no_of_pre_approved_adu_spots` int(11) NOT NULL DEFAULT '0',
  `no_of_need_buyer_approval_adu_spots` int(11) NOT NULL DEFAULT '0',
  `pre_approved_adu_spots_grp` double NOT NULL DEFAULT '0',
  `need_buyer_approval_adu_spots_grp` double NOT NULL DEFAULT '0',
  `pre_approved_adu_spots_value` double NOT NULL DEFAULT '0',
  `need_buyer_approval_adu_spots_value` double NOT NULL DEFAULT '0',
  `buyer_added_spots` int(11) NOT NULL DEFAULT '0',
  `buyer_removed_spots` int(11) NOT NULL DEFAULT '0',
  `buyer_added_spots_value` double NOT NULL DEFAULT '0',
  `buyer_added_spots_rating` double NOT NULL DEFAULT '0',
  `buyer_removed_spots_value` double NOT NULL DEFAULT '0',
  `buyer_removed_spots_rating` double NOT NULL DEFAULT '0',
  `order_type` enum('DAILY','WEEKLY') NOT NULL DEFAULT 'WEEKLY',
  `sales_office_address` varchar(30) NOT NULL DEFAULT '',
  `alternate_number` varchar(20) NOT NULL DEFAULT '',
  `universe_size` int(11) NOT NULL,
  `agency_commission_percentage` double DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `fk_ro_status` (`ro_status`),
  KEY `fk_ro_operation` (`ro_operation`),
  KEY `fk_sky_master_deal` (`proposal_id`),
  KEY `fk_sky_external_campaign_input` (`sky_external_campaign_input_id`),
  KEY `fk_avt_user` (`assigned_to_user_id`),
  KEY `fk_sky_order_input_id` (`sky_order_input_id`),
  KEY `fk__sky_agency_advertiser_email__advertiser_id__idx` (`advertiser_id`),
  KEY `fk__sky_agency_campaign_email__agency_user_id__idx` (`agency_user_id`),
  KEY `sky_ro_campaign_id_channel_id_revision_number_index` (`campaign_id`,`channel_id`,`revision_number`),
  CONSTRAINT `sky_agency_advertiser__email__advertiser_id__fk__id` FOREIGN KEY (`advertiser_id`) REFERENCES `sky_advertiser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `table1_ibfk_1` FOREIGN KEY (`ro_status`) REFERENCES `sky_edit_campaign_status` (`id`),
  CONSTRAINT `table1_ibfk_2` FOREIGN KEY (`ro_operation`) REFERENCES `sky_edit_campaign_status` (`id`),
  CONSTRAINT `table1_ibfk_3` FOREIGN KEY (`proposal_id`) REFERENCES `sky_master_deal` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `table1_ibfk_4` FOREIGN KEY (`sky_external_campaign_input_id`) REFERENCES `sky_external_campaign_input` (`id`),
  CONSTRAINT `table1_ibfk_5` FOREIGN KEY (`assigned_to_user_id`) REFERENCES `avt_user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `table1_ibfk_6` FOREIGN KEY (`sky_order_input_id`) REFERENCES `sky_order_input` (`id`),
  CONSTRAINT `sky_agency_advertiser_email__campaign_id__fk__id` FOREIGN KEY (`campaign_id`) REFERENCES `sky_campaign` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `sky_agency_advertiser_email__channel_id__fk__id` FOREIGN KEY (`channel_id`) REFERENCES `avt_channel` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `sky_agency_campaign_email__agency_user_id__fk__id` FOREIGN KEY (`agency_user_id`) REFERENCES `agency_user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=320 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `table1`
--

LOCK TABLES `table1` WRITE;
/*!40000 ALTER TABLE `table1` DISABLE KEYS */;
INSERT INTO `table1` VALUES ('some values')
/*!40000 ALTER TABLE `table1` ENABLE KEYS */;
UNLOCK TABLES;

Я попробовал следующие вещи

  • Flu sh таблицы
  • Попытка изменить innodb_file_per_table на off, но безуспешно, так как доступ требуется для суперпользователя.
  • очистка кэша запросов

    Я все еще получаю ошибку таблицы уже существует.

...