我试图使用pgloader将mysql迁移到postgres,因为我使用的是窗口,因此,我在windows linux子系统中安装了pgloader,我使用以下命令迁移DB pgloader mysql://root@localhost/f1db pgsql://postgres@localhost:5433/f1db
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。
发布于 2021-01-27 21:47:52
来自pgloader 参考手册 (https://pgloader.readthedocs.io/en/latest/pgloader.html):
命令行:
pgloader SOURCE TARGET源连接字符串
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上所描述的那样。
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中所记录的那样。
https://stackoverflow.com/questions/61791539
复制相似问题