[英]MySQL to Postgresql backup invalid command due to "`"?
I have an old backup sql file with `
in it.我有一个带有
`
的旧备份 sql 文件。 When I try to load it via psql dbname < db_backup.sql
I get an error:当我尝试通过
psql dbname < db_backup.sql
加载它时,出现错误:
ERROR: syntax error at or near "`" DROP TABLE IF EXISTS `tablename`;
Is there a way to tell psql to treat `
like '
?有没有办法告诉 psql 对待
`
like '
?
You should create the dump using mysqldump --compatible=ansi
to avoid this and other migration incompatibilities.您应该使用
mysqldump --compatible=ansi
创建转储以避免这种和其他迁移不兼容性。 I suggest you make a separate MySQL database using your existing backup as it is, then do a dump with this option to make the compatible one.我建议您使用现有备份创建一个单独的 MySQL 数据库,然后使用此选项进行转储以使其兼容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.