【问题标题】:Failed to migrate from Mysql 8 to postgres using pgloader使用 pgloader 从 Mysql 8 迁移到 postgres 失败
【发布时间】:2021-01-23 18:19:51
【问题描述】:

我正在尝试从 MySQL 迁移到 PostgreSQL 数据库。

有什么方法可以在不修改my.cnf文件的情况下从MySQL迁移到PostgreSQL?

pgloader mysql://root:root_password@127.0.0.1/mysql_database postgresql://postgres_user:postgres_pass@127.0.0.1/postgres_database

我尝试创建这个:

create user 'pgloader'@'localhost' identified with mysql_native_password by 'pass'

但是当我尝试迁移时,我总是得到这个错误:

Failed to connect to mysql at "localhost" (port 3306) as user "pgloader": Condition QMYND:MYSQL-UNSUPPORTED-AUTHENTICATION was signalled.

【问题讨论】:

    标签: mysql postgresql migration pgloader


    【解决方案1】:

    截至 2021 年 4 月,pgloader 不支持 MySQL v8 中较新的 SHA2 身份验证模式。 (升级的工作量相当大。)

    去年我遇到过 3 次这个问题。

    第一种方法

    对于第一个客户端,我能够将 MySQL 降级到 v5.6 following comments here.

    第二种方法

    对于第二个拥有小型数据库的客户端,我一起破解了一些 shell 脚本。

    1. SSH 获取mysqldump(绝对需要使用选项。)
    2. Reformatting SQL syntax to postgres.
    3. 然后针对 postgres 目标执行。

    第三种方法

    我的第三个客户有更多的数据,数百个表中有 4-5TB。

    这次我找到了NMIG, a Node-based configurable data migration tool.,经过一些调整和配置,它似乎工作得很好。

    我以后肯定会选择 NMIG。

    【讨论】:

      猜你喜欢
      • 2020-08-30
      • 1970-01-01
      • 1970-01-01
      • 2020-06-06
      • 2023-03-14
      • 1970-01-01
      • 2016-03-30
      • 1970-01-01
      • 2012-07-21
      相关资源
      最近更新 更多