MySQL Syntax error when locally importing dump from Amazon MySQL RDS?

后端 未结 2 954
春和景丽
春和景丽 2021-01-24 21:43

When I create a database dump from Amazon RDS and then I try to import it locally, the result is ERROR 1064 (42000) at line 54.

At line 54 there is the foll

相关标签:
2条回答
  • 2021-01-24 22:03

    The problem is with datetime(6). MySql introduced storing of fractional seconds in v5.6.4. The syntax for indicating fractional seconds in datetime - this is the (6) - is not recognised by previous mysql versions.

    The data was exported from a mysql v5.6.4 or later, and was attempted to be imported into an earlier version. Since the error message starts with (6), I believe that this is the problem.

    0 讨论(0)
  • 2021-01-24 22:16

    'key' is a reserved word in MySQL, and shouldn't be used as a column name. It's possible that a different version on Amazon RDS allowed it, but your best bet is to change the column name to something different.

    0 讨论(0)
提交回复
热议问题