Select to view content in your preferred language

OGR.Open() on datasources with a password

407
1
09-20-2023 02:11 PM
AlfredBaldenweck
MVP Regular Contributor

Hey all, this should be pretty simple but I'm struggling pretty hard.

I'm trying to use ogr to open up some databases, some of which have passwords. I know the passwords.

How do I use ogr.Open() and enter a password for this datasource?

Thanks!

1 Reply
ShaunWalbridge
Esri Regular Contributor

What driver are you using? The correct way to access the resource will be dependent on the driver, for example the Postgres driver supports a number of different formats for authentication. you may be best served first confirming you can access the data with the command line tools, then switching to using the Python bindings afterward. 

0 Kudos