首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用pgloader将mysql迁移到postgres

使用pgloader将mysql迁移到postgres
EN

Stack Overflow用户
提问于 2020-05-14 07:20:42
回答 1查看 2.2K关注 0票数 3

我试图使用pgloader将mysql迁移到postgres,因为我使用的是窗口,因此,我在windows linux子系统中安装了pgloader,我使用以下命令迁移DB pgloader mysql://root@localhost/f1db pgsql://postgres@localhost:5433/f1db

代码语言:javascript
复制
    KABOOM!
FATAL error: Failed to connect to pgsql at "localhost" (port 5433) as user "postgres": Server requested md5-password authentication, but no password was given.
An unhandled error condition has been signalled:
   Failed to connect to pgsql at "localhost" (port 5433) as user "postgres": Server requested md5-password authentication, but no password was given.




What I am doing here?

Failed to connect to pgsql at "localhost" (port 5433) as user "postgres": Server requested md5-password authentication, but no password was given.


Waiting for the monitor thread to complete.

请告诉我们如何在命令行中传递MYsql和Postgres的密码,如果我的密码中有@,那么如何在命令中使用它,因为命令中已经有user@localhost。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-27 21:47:52

来自pgloader 参考手册 (https://pgloader.readthedocs.io/en/latest/pgloader.html):

命令行:

代码语言:javascript
复制
pgloader SOURCE TARGET

源连接字符串

代码语言:javascript
复制
db://user:pass@host:port/dbname

其中db可能是sqlite、mysql或mssql。

连接字符串

该参数预计将作为连接URI提供,如PostgreSQL文档在http://www.postgresql.org/docs/9.3/static/libpq-connect.html#LIBPQ-CONNSTRING上所描述的那样。

代码语言:javascript
复制
postgresql://[user[:password]@][netloc][:port][/dbname][?option=value&...]

用户

可以包含任何字符,包括冒号(:),然后必须加倍(::)和at-符号(@),然后必须加倍(@@)。

如果省略,用户名默认为PGUSER环境变量的值,如果未设置,则为user环境变量的值。

密码

可以包含任何字符,包括必须加倍(@)的at符号(@)。要使密码为空,当用户名以at符号结尾时,您必须使用user:@语法。

如果省略,密码默认为PGPASSWORD环境变量的值(如果设置的话),否则密码将未设置。

当在连接URI或环境中没有找到密码时,pgloader将查找.pgpass文件,如https://www.postgresql.org/docs/current/static/libpq-pgpass.html中所记录的那样。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61791539

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档