https://www.cnblogs.com/java365/articles/17789520.html
用centos7.9才实现的,arm架构的弄了半天没弄起来。
一、解压,并授权执行pgloader安装脚本
cd /usr/local
tar -zxvf pgloader-3.6.9.tar.gz
cd pgloader-3 .6.9/
chmod 755 bootstrap-centos.sh
#需要下载很多关联插件
./bootstrap-centos.sh
#先package打包,后还要下载一些资源包#此版本打包时,需要用到 openSSL11 版本的 so 库,#如果有提示到 ("libcrypto.so.1.1" "libcrypto.so.1.0.0" "libcrypto.so.3" "libcrypto.so") 相关信息,#需要先执行一下 yum -y install openssl openssl-devel ,再重新 make 。
make pgloader#复制执行文件到用户本地执行目录cp build/bin/pgloader /usr/local/bin/#查看版本pgloader --version
如果出现类似情况:
临时解决:
另外开窗口执行:
SBCL_HEAP_SIZE=4096 sbcl
这是gpt的解释:
GitHub社区有大佬扯半天,没看懂,感兴趣的可以looklook:
https://github.com/dimitri/pgloader/issues/327
二、开始执行命令迁移
#MySQL对应的用户、密码,数据据地址和对应的库,
#PostgreSQL 对应的用户、密码,数据据地址和对应的库。
#此操作的全库数据库表转换,包含全部数据,无法单独选择某些表。#导入的数据,会在当前数据库下,建新的同名模式(Schema)方式生成。#如果遇到账户名或密码中有特殊字符,比如 @ 符号,则需要用在特殊字符之后,多加一个@来进行标记。#比如原来的密码是root@123,则在 pgloader 的命令行里,就成了 root@@123 。
pgloader mysql://user:password@localhost:port/dbName postgresql://user:password@localhost:5432/dbName
如果报错mysql连接失败问题,需要添加认证插件mysql_native_password
一般在my.cnf配置文件中添加:
default-authentication-plugin=mysql_native_password
最后Maven项目中怎么连接pgsql
master:
url: jdbc:postgresql://localhost:5432/postgres?currentSchema=db&verifyServerCertificate=false&useSSL=false&requireSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&autoReconnect=true&allowPublicKeyRetrieval=true
username: postgres
password: pgsql123
driver-class-name: org.postgresql.Driver
slave_1:
url: jdbc:postgresql://localhost:5432/postgres?currentSchema=db&verifyServerCertificate=false&useSSL=false&requireSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&autoReconnect=true&allowPublicKeyRetrieval=true
username: postgres
password: pgsql123
driver-class-name: org.postgresql.Driver