gpt4 book ai didi

mysql - 导出后数据库导入错误

转载 作者:可可西里 更新时间:2023-11-01 06:39:44 24 4
gpt4 key购买 nike

正如标题所说。我正在使用 HeidiSQL,我不想复制数据库,所以我导出数据库,创建一个名为“test”的新空数据库。然后我在 .sql 文件中将数据库的名称更改为“test”并尝试导入数据库,然后我收到此错误

Error de SQL (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right

syntax to use near '--

-- Host: ' at line 1

我想是关于sql文件的第一部分,也就是

-- --------------------------------------------------------
-- Host:
-- Versión del servidor: 5.5.41 - MySQL Community Server (GPL) by Remi
-- SO del servidor: Linux
-- HeidiSQL Versión: 9.1.0.4867
-- --------------------------------------------------------

据我所知,它应该只是评论。

有什么建议吗?

提前致谢,抱歉,如果这是一个白痴问题,但不知道如何解决,我搜索没有结果。对不起,如果我的英语也不完美。

更新:文件的前 100 行

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

-- Volcando estructura de base de datos para desarrolloweb
CREATE DATABASE IF NOT EXISTS `test` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `test`;


-- Volcando estructura para tabla desarrolloweb.tqg2h_akeeba_common
CREATE TABLE IF NOT EXISTS `tqg2h_akeeba_common` (
`key` varchar(255) NOT NULL,
`value` longtext NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Volcando datos para la tabla desarrolloweb.tqg2h_akeeba_common: ~3 rows (aproximadamente)
/*!40000 ALTER TABLE `tqg2h_akeeba_common` DISABLE KEYS */;
INSERT INTO `tqg2h_akeeba_common` (`key`, `value`) VALUES
('stats_lastrun', '1419900936'),
('stats_siteid', '89afdf9407b43fb898c32abbabbdae6f4d9aefc8'),
('stats_siteurl', '94599098f96a3bbdb57077a7334fd064');
/*!40000 ALTER TABLE `tqg2h_akeeba_common` ENABLE KEYS */;


-- Volcando estructura para tabla desarrolloweb.tqg2h_ak_params
CREATE TABLE IF NOT EXISTS `tqg2h_ak_params` (
`tag` varchar(255) NOT NULL,
`data` longtext,
PRIMARY KEY (`tag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Volcando datos para la tabla desarrolloweb.tqg2h_ak_params: ~1 rows (aproximadamente)
/*!40000 ALTER TABLE `tqg2h_ak_params` DISABLE KEYS */;
INSERT INTO `tqg2h_ak_params` (`tag`, `data`) VALUES
('update_version', '1.2.0');
/*!40000 ALTER TABLE `tqg2h_ak_params` ENABLE KEYS */;


-- Volcando estructura para tabla desarrolloweb.tqg2h_ak_profiles
CREATE TABLE IF NOT EXISTS `tqg2h_ak_profiles` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`description` varchar(255) NOT NULL,
`configuration` longtext,
`filters` longtext,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- Volcando datos para la tabla desarrolloweb.tqg2h_ak_profiles: ~1 rows (aproximadamente)
/*!40000 ALTER TABLE `tqg2h_ak_profiles` DISABLE KEYS */;
INSERT INTO `tqg2h_ak_profiles` (`id`, `description`, `configuration`, `filters`) VALUES
(1, 'Default Backup Profile', '###AES128###+wNhUfQrnLFFGIxJfsqqq3NIRFdOAXfnDfQGV0GFrv0SEKKsrowqaqikqxO/Ej9ikG8kmDCKRq0Yt/vkM11aVkvLFYyDMXC/FilnxIkcT+BF/SNP0IGj0xT4FUmRZjUhhmBNl9cnWfIVxRioEGI/VJ4zk1TyhNIHc8tDhTwKus/ca5WB0nBe1u+N4hwMWMKOiovdCCSM7/BADHg6blaqhcBVL/J8mAE7pJApN/RmO6k3cMMuH5916XdOhJzQOL0ZmoaO3W+42VLTpZPp1vb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 ALTER TABLE `tqg2h_ak_profiles` ENABLE KEYS */;


-- Volcando estructura para tabla desarrolloweb.tqg2h_ak_stats
CREATE TABLE IF NOT EXISTS `tqg2h_ak_stats` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`description` varchar(255) NOT NULL,
`comment` longtext,
`backupstart` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`backupend` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` enum('run','fail','complete') NOT NULL DEFAULT 'run',
`origin` varchar(30) NOT NULL DEFAULT 'backend',
`type` varchar(30) NOT NULL DEFAULT 'full',
`profile_id` bigint(20) NOT NULL DEFAULT '1',
`archivename` longtext,
`absolute_path` longtext,
`multipart` int(11) NOT NULL DEFAULT '0',
`tag` varchar(255) DEFAULT NULL,
`backupid` varchar(255) DEFAULT NULL,
`filesexist` tinyint(3) NOT NULL DEFAULT '1',
`remote_filename` varchar(1000) DEFAULT NULL,
`total_size` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_fullstatus` (`filesexist`,`status`),
KEY `idx_stale` (`status`,`origin`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Volcando datos para la tabla desarrolloweb.tqg2h_ak_stats: ~0 rows (aproximadamente)
/*!40000 ALTER TABLE `tqg2h_ak_stats` DISABLE KEYS */;
/*!40000 ALTER TABLE `tqg2h_ak_stats` ENABLE KEYS */;


-- Volcando estructura para tabla desarrolloweb.tqg2h_ak_storage
CREATE TABLE IF NOT EXISTS `tqg2h_ak_storage` (
`tag` varchar(255) NOT NULL,
`lastupdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`data` longtext,
PRIMARY KEY (`tag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Volcando datos para la tabla desarrolloweb.tqg2h_ak_storage: ~0 rows (aproximadamente)
/*!40000 ALTER TABLE `tqg2h_ak_storage` DISABLE KEYS */;
/*!40000 ALTER TABLE `tqg2h_ak_storage` ENABLE KEYS */;

最佳答案

在我的例子中,解决方案是更改 sql 文件中的字符集。打开数据库 .sql 文件并将 /*!40101 SET NAMES utf8mb4 */; 替换为 /*!40101 SET NAMES utf8 */; .

关于mysql - 导出后数据库导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28507503/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com