Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6422

I cannot connect to database using WSL Ubuntu, but everything works on windows

$
0
0

I get"Exception has occurred: OperationalError(psycopg2.OperationalError) could not translate host name "stat-hh-postgresql" to address: Name or service not known"when I run a function with Ubuntu but the same function works well with windows.

Also another function that fails to connect to MySQL database via Ubuntu, works well with windows.

def connect_to_modelDB():        engine = create_engine("postgresql+psycopg2://username:password@stat-hh-postgresql:5432/DBname")        modelDB = engine.connect()        return modelDBgeos = query_table_from_modelDB("geos")

I get "Exception has occurred: OperationalError(psycopg2.OperationalError) could not translate host name "stat hh postgresql" to address: Name or service not known

(Background on this error at: https://sqlalche.me/e/14/e3q8)psycopg2.OperationalError: could not translate host name "stat-hh-postgresql" to address: Name or service not known"


Viewing all articles
Browse latest Browse all 6422

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>