gpt4 book ai didi

mysql - 在Mysql 5.7中导入MySql dump时出错

转载 作者:行者123 更新时间:2023-11-29 11:15:18 26 4
gpt4 key购买 nike

我们在导入数据库时​​遇到一些错误。

CREATE TABLE `pf_class_room` (
`id` int(11) NOT NULL,
`class_name` varchar(500) DEFAULT NULL,
`class_min_limit` int(11) DEFAULT '0',
`class_max_limit` int(11) NOT NULL,
`class_from_date` date DEFAULT NULL,
`class_from_time` time DEFAULT NULL,
`class_to_date` date DEFAULT NULL,
`class_to_time` time DEFAULT NULL,
`class_address` varchar(1000) DEFAULT NULL,
`class_country` varchar(50) DEFAULT NULL,
`class_city` varchar(50) DEFAULT NULL,
`class_pin` varchar(10) DEFAULT NULL,
`class_course` int(11) DEFAULT NULL,
`class_trainer` int(11) DEFAULT NULL,
`cost` int(11) NOT NULL,
`costformat` varchar(11) NOT NULL,
`status` int(11) NOT NULL DEFAULT '0'COMMENT
)
#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 ')' at line 19

这里我们删除了COMMENT并导入了脚本。

我们还遇到了如下错误:

2 errors were found during analysis.

Ending quote ' was expected. (near "" at position 15650)
7 values were expected, but found 6. (near "(" at position 15576)

在创建表定义之一

`future_courses` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT AS `Scope or Eligibility for certain courses in the future`,

出现类似错误

#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 'AS `Scope or Eligibility for certain courses in the future`,

我们在注释、单引号等附近遇到错误。看起来导出或导入存在问题。我们有160多张 table 。所以这种错误反复地影响着我们。有什么解决办法吗?

最佳答案

我找到了解决方案。

我正在使用 phpmyadmin 导入/导出。所以我们面临这些问题。

现在我们尝试使用命令行,一切正常,没有任何问题。

用它来导出:

mysqldump -u username -p databasename > filename.sql

使用它进行导入:

mysql -u username -p databasename < filename.sql

关于mysql - 在Mysql 5.7中导入MySql dump时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39855676/

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