OGR.Open() on datasources with a password

09-20-2023 02:11 PM
Occasional Contributor III

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?


1 Reply
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