pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

The value NIL is not of type STRING when binding STRING

Open Jayesh-Mahato opened this issue 3 years ago • 1 comments

I have downloaded latest Git repo and installed pgloader in macOS Monterey.

There after I have used the following command to migrate DB from MySQL server to Postgres server:

./build/bin/pgloader mysql://root@localhost/mydb pgsql://postgres@localhost/mydb

I am receiving the following error in terminal:

Failed to connect to pgsql at "localhost" (port 5432) as user "postgres": The value
  NIL
is not of type
  STRING
when binding STRING
An unhandled error condition has been signalled:
   Failed to connect to pgsql at "localhost" (port 5432) as user "postgres": The value
  NIL
is not of type
  STRING
when binding STRING




What I am doing here?

Failed to connect to pgsql at "localhost" (port 5432) as user "postgres": The value
  NIL
is not of type
  STRING
when binding STRING

I had also tried the docker version and received the same error above. Please guide me with this issue.

Jayesh-Mahato avatar Sep 19 '22 12:09 Jayesh-Mahato

You need to include a password as an environment variable or directly in the connection string

e.g. mysql://root:password@localhost/mydb

See: https://pgloader.readthedocs.io/en/latest/pgloader.html?highlight=password#connection-string

justinfalk avatar Sep 21 '22 22:09 justinfalk

Done. Thanks.

Jayesh-Mahato avatar Sep 22 '22 01:09 Jayesh-Mahato

Thanks for your post. The pgloader command that worked for me was:

pgloader --verbose --type sqlite db.sqlite3 postgresql://mike:password@localhost/cryptodb

Before pgloader I was trying to use the django dumpdata w/ sqlite and loaddata w/ postgres with no success due to ContentTypes and Wagtail problems.

mikeredbike avatar Dec 31 '22 21:12 mikeredbike

Help! I have a very similar problem.... I have installed pgloader in Ubuntu 22.04.

There after I have used the following command to migrate DB from SQL Server to Postgres server:

pgloader mssql://SA:mypassword@localhost/myDB pgsql://postgres@localhost/myDB

I am receiving the following error in terminal:

2023-08-28T16:55:07.008000Z LOG pgloader version "3.6.7~devel"
2023-08-28T16:55:07.008000Z LOG Data errors in '/tmp/pgloader/'
KABOOM!
DB-CONNECTION-ERROR: Failed to connect to pgsql at "localhost" (port 5432) as user "postgres": The value
NIL
is not of type
STRING
when binding STRING
An unhandled error condition has been signalled:
Failed to connect to pgsql at "localhost" (port 5432) as user "postgres": The value
NIL
is not of type
STRING
when binding STRING

What I am doing here?

Failed to connect to pgsql at "localhost" (port 5432) as user "postgres": The value
NIL
is not of type
STRING
when binding STRING

Please help, What could be wrong?

frannfuri avatar Aug 28 '23 17:08 frannfuri

Instead of postgres@localhost try postgres:password@localhost

mikeredbike avatar Aug 29 '23 04:08 mikeredbike

Instead of postgres@localhost try postgres:password@localhost

But in postgres I don't have a password associated. Anyway, I just tried what you told me and it didn't work either :(

frannfuri avatar Aug 29 '23 13:08 frannfuri

Now it works, I have to create a password for my user postgres

frannfuri avatar Aug 29 '23 15:08 frannfuri