mysql:第1003行出现错误1005(hy000):无法创建表“magento.”(错误号:-1)

iyr7buue  于 2021-06-18  发布在  Mysql
关注(0)|答案(1)|浏览(445)

我尝试通过phpmyadmin、adminer.php和ssh上传magento.sql文件。但我犯了下面这样的错误。

1. Error in query (1005): Can't create table 'dubaycloud.catalogsearch_query'. (errno: -1)

2. Error in query (1146): Table 'dubaycloud.catalogsearch_query' doesn't exist.

3. Error in query (1050): Table '`dubaycloud`.`catalogsearch_result`' already exists.

查询:

DROP TABLE IF EXISTS `catalogsearch_query`;
CREATE TABLE `catalogsearch_query` (
  `query_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Query ID',
  `query_text` varchar(255) DEFAULT NULL COMMENT 'Query text',
  `num_results` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Num results',
  `popularity` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Popularity',
  `redirect` varchar(255) DEFAULT NULL COMMENT 'Redirect',
  `synonym_for` varchar(255) DEFAULT NULL COMMENT 'Synonym for',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `display_in_terms` smallint(6) NOT NULL DEFAULT '1' COMMENT 'Display in terms',
  `is_active` smallint(6) DEFAULT '1' COMMENT 'Active status',
  `is_processed` smallint(6) DEFAULT '0' COMMENT 'Processed status',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated at',
  PRIMARY KEY (`query_id`),
  KEY `IDX_CATALOGSEARCH_QUERY_QUERY_TEXT_STORE_ID_POPULARITY` (`query_text`,`store_id`,`popularity`),
  KEY `IDX_CATALOGSEARCH_QUERY_STORE_ID` (`store_id`),
  KEY `IDX_CATALOGSEARCH_QUERY_NUM_RESULTS` (`num_results`),
  KEY `IDX_CATALOGSEARCH_QUERY_QUERY_TEXT` (`query_text`),
  KEY `IDX_CATALOGSEARCH_QUERY_QUERY_TEXT_STORE_ID_NUM_RESULTS` (`query_text`,`store_id`,`num_results`),
  KEY `IDX_CATALOGSEARCH_QUERY_SYNONYM_FOR` (`synonym_for`),
  CONSTRAINT `FK_CATALOGSEARCH_QUERY_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog search query table';

查询错误(1005):无法创建表“dubaycloud.catalogsearch\u query”(错误号:-1)

6mw9ycah

6mw9ycah1#

我用另一种方法解决了上述问题。对我有用。

1. I have removed the old database and created the new database with different name and set collation: utf8_unicode_ci.

相关问题