MySQL ODBC 导入失败

标签 mysql excel mysqlimport powerpivot

我正在将数据从 MySQL 导入到 PowerPivot。我有所有相关的驱动程序。当我尝试导入到 PowerPivot 时,出现以下错误:

当我从表格列表中选择时:

Failed to retrieve data from companies. Reason: ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.1.58]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 '[companies].* FROM [companies]' at line 1

当我“编写一个已验证的查询”时,我收到:

The following system error occurred: Catastrophic failure A connection could not be made to the data source with the DataSourceID of 'dc746dc9-4aaa-4e03-b938-f84a128f5671', Name of 'Custom'. An error occurred while processing the 'Query' table. The operation has been cancelled.

但是,我能够很好地导入到 Excel 中。如何修复 PowerPivot 导入?

最佳答案

就在今天,我遇到了这个问题。似乎 Excel 在字段中遇到“难以消化”的内容时无法导入表格。在我的例子中,字段类型是文本,所以可能某些字段只包含很多数据。然后整个导入失败。

所以我所做的是选择另一个选项,使用 SQL 查询导入。

select field_a, field_b from the_table

您只是省略了导致问题的列,在您的情况下为“自定义”。

如果您需要此专栏,那么您可以启发式地查看其内容以找出潜在的麻烦制造者。

关于MySQL ODBC 导入失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8153984/

相关文章:

python - 有效地序列化 JSON 对象

PHP: try catch 异常

excel - 组合多个 IF 公式

python - 使用 Python 的 Pandas 进行电子表格操作的技巧

mysql - 如何将大型数据集导入 mysql - 正确的方法?

mysql - 查询优化 CASE 与 UNION

PHPExcel - 如何将边框应用于从 mysql 数据加载的动态单元格范围

mysql - 使用 "MySQL for Excel plugin"从 Excel 导出到 MySQL 非常慢

mysql导入将时间戳空值转换为0000-00-00 00 :00:00

php - CakePHP 2.9 连接查询返回错误结果