【问题标题】:Migrate database from MySQL to PostgreSQL via Pgloader in Cent OS在 Cent OS 中通过 Pgloader 将数据库从 MySQL 迁移到 PostgreSQL
【发布时间】:2016-10-17 08:43:59
【问题描述】:

我很困惑,不明白这是怎么回事。我在 Mac OS X 中使用pgloader 将数据从 MySQL 迁移到 PostgreSQL 数据库。

Mac OSX

我试过了

pgloader mysql://root@localhost/local postgresql://postgres@localhost/portal

我明白了

2016-06-15T13:11:23.017000-07:00 LOG Main logs in '/private/tmp/pgloader/pgloader.log'
2016-06-15T13:11:23.060000-07:00 LOG Data errors in '/private/tmp/pgloader/'
2016-06-15T13:11:23.262000-07:00 WARNING PostgreSQL warning: table "mirror_settings" does not exist, skipping
            table name       read   imported     errors            time
----------------------  ---------  ---------  ---------  --------------
       fetch meta data         25         25          0          0.092s
          create, drop          0         26          0          0.217s
----------------------  ---------  ---------  ---------  --------------
                caches          1          1          0          0.156s
       captive_portals          5          5          0          0.074s
              captures          2          2          0          0.029s
      cloud_securities          7          7          0          0.024s
               devices         88         88          0          0.056s
             externals          1          1          0          0.018s
            migrations         52         52          0          0.028s
       mirror_settings          1          1          0          0.036s
         notifications          7          7          0          0.038s
             operators          1          1          0          0.014s
            promotions          5          5          0          0.015s
                 users        224        224          0          0.020s
              visitors         14         14          0          0.013s
Index Build Completion          0          0          0          0.020s
----------------------  ---------  ---------  ---------  --------------
        Create Indexes         12         12          0          0.124s
       Reset Sequences          0         11          0          0.012s
          Primary Keys         11         11          0          0.009s
          Foreign Keys          0          0          0          0.000s
              Comments          0          0          0          0.000s
----------------------  ---------  ---------  ---------  --------------
     Total import time        408        408          0          0.871s

所有表格及其中的数据都完美导入。


Cent OS 6.7(64 位)

然后,我以 root@172.16.139.1 身份通过 SSH 连接到本地 VM 并运行

pgloader mysql://root@172.16.139.1/local postgresql://postgres@172.16.139.130/portal

我明白了

debugger invoked on a SIMPLE-ERROR in thread
#<THREAD "main thread" RUNNING {10070AB033}>:
  Error opening shared object "libssl.so.1.0.0":
  libssl.so.1.0.0: cannot open shared object file: No such file or directory.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE       ] Skip this shared object and continue.
  1: [RETRY          ] Retry loading this shared object.
  2: [CHANGE-PATHNAME] Specify a different pathname to load the shared object from.

(SB-SYS:DLOPEN-OR-LOSE #S(SB-ALIEN::SHARED-OBJECT :PATHNAME #P"libssl.so.1.0.0" :NAMESTRING "libssl.so.1.0.0" :HANDLE NIL :DONT-SAVE NIL))
0] 0
An unhandled error condition has been signalled:
   The value NIL
   is not of type
     (OR (VECTOR CHARACTER) (VECTOR NIL) BASE-STRING PATHNAME STREAM).

; 
; compilation unit aborted
;   caught 1 fatal ERROR condition

【问题讨论】:

  • 等等,我的第一个命令,我在我的 Mac 中运行它并将它指向我的虚拟机,该虚拟机也是我的 Mac 主机。我认为我没有为本地 VM 安装任何类型的 SSL。你确定吗 ?另外,如何安装 libssl ?希望你不要介意。
  • 我认为我没有在本地 VM 上购买或启用任何类型的 SSL。我不是说你错了,因为即使是我我也不确定。如何检查我的本地 VM 是否启用/安装了 SSL。
  • 注意:当我 ssh 进入我的本地 linux cent OS VM 时,就会出现问题。我的 Mac 上没有出现此问题。
  • 我在我的 Mac 上尝试了brew install ssl(不知道为什么我需要这样做) - 但我得到了Warning: openssl-1.0.2h_1 already installed
  • 对不起,我也有点糊涂了。只有在 centos 中执行 pgloader 命令时才看到错误,而在 mac 上没有?

标签: mysql database macos postgresql centos


【解决方案1】:

我相信您的 pgloader 安装已损坏。 http://tapoueh.org/pgloader/download.html 上的下载链接,您似乎从中获取了 RPM,但不幸的是,自那以后发生了很多变化。

我建议你试试官方的postgresql YUM repository。请先卸载之前安装的 RPM。然而,即使这个存储库也将 pgloader 标记为不完全兼容。因此,如果此选项失败,您将别无选择,只能从源代码编译。

【讨论】:

  • 感谢您的详细回答。
  • 不,它不起作用。我有 6.7,我使用 6.4 的那个。我不确定现在该怎么做,我在 pgloader git hub 站点上创建了问题。我希望他们能给我一些提示。
  • 你尝试了哪一个?从 postgresql YUM repo 或源安装安装?
  • 昨天,我尝试从 git hub site 克隆。
  • 通常用 yum install 包。
猜你喜欢
  • 2011-07-16
  • 2018-10-02
  • 2020-08-30
  • 2014-07-05
  • 2016-06-22
  • 1970-01-01
  • 2023-03-09
  • 2020-06-01
  • 1970-01-01
相关资源
最近更新 更多