flask-sqlalchemy returning no config directory to search for tnsnames.ora when trying to connect #239
Replies: 2 comments
-
Thin mode does in fact look at tnsnames.ora when the connect string supplied doesn't start with a "(" character and isn't an easy connect string. You can set the environment variable TNS_ADMIN to provide the location where the tnsnames.ora file will be searched, but in this case it looks more like a potential issue with how connect strings are passed through to SQLAlchemy -- but I don't know enough about SQLAlchemy connect strings to be able to help there, unfortunately! Perhaps post this in the SQLAlchemy help forum? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all,
When I try to connect to my Oracle Cloud autonomous DB with the flask-sqlalchemy package I get this error:
when I use the SQLALCHEMY_DATABASE_URI = 'oracle+oracledb://username:password@dsn'
and the dsn being:
dsn = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.uk-london-1.oraclecloud.com))(connect_data=(service_name=example_database_medium.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))
sqlalchemy and oracledb both default to 'thin' mode I am not sure why it should be looking for tnsnames.ora
However when i set sqlalchemy database uri to:
SQLALCHEMY_DATABASE_URI = 'oracle+oracledb://username:[email protected]:1522/?service_name=example_database_medium.adb.oraclecloud.com'
I get the error:
This is unusual because I can connect to my DB just fine when going through the actual oracledb package on a different python file using:
with cs being the same string as the DSN i showed earlier.
My Current Package versions are:
Any help or ideas would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions