dimitri / pgloader

Migrate to PostgreSQL in a single command!
http://pgloader.io
Other
5.47k stars 550 forks source link

The value NIL is not of type STRING when binding STRING #1433

Closed Jayesh-Mahato closed 2 years ago

Jayesh-Mahato commented 2 years ago

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.

justinfalk commented 2 years ago

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

Jayesh-Mahato commented 2 years ago

Done. Thanks.

mikeredbike commented 1 year ago

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.

frannfuri commented 1 year ago

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?

mikeredbike commented 1 year ago

Instead of postgres@localhost try postgres:password@localhost

frannfuri commented 1 year ago

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 commented 1 year ago

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