关于mysql:尝试导入表时出现语法错误

Syntax error when trying to import table

本问题已经有最佳答案,请猛点这里访问。

我正试图将一个表从数据库导入到另一个数据库,但一直出现此错误

命令:

1
2
3
4
5
6
7
8
INSERT IGNORE INTO epdbraid.spawnpoints (
    id, spawn_id, lat, lon, despawn_time, updated
)
SELECT
    0,
    CAST(CONV(id,16,10) AS INTEGER),
    latitude, longitude, latest_seen, last_scanned
FROM rocketmapdb.spawnpoint;

错误:

ERROR 1064 (42000): 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 'INTEGER), latitude, longitude, latest_seen, last_scanned FROM rocketmapdb.spawnp' at line 1

SQL版本:mysql ver 14.14 distrib 5.7.18,用于Linux(x86_64),使用editline包装器

知道我做错了什么吗?


1
2
3
4
5
6
7
8
INSERT IGNORE INTO epdbraid.spawnpoints (
    id, spawn_id, lat, lon, despawn_time, updated
)
SELECT
    0,
    CAST(CONV(id,16,10) AS  UNSIGNED ),
    latitude, longitude, latest_seen, last_scanned
FROM rocketmapdb.spawnpoint;

你可以试试上面的代码。

希望这对你有帮助。