siteLink contentI tried to connect to postgreSQL from Python with reference to and entered the following code
import psycopg2 conn = psycopg2.connect (host = '000', dbname ='sample', user ='postgres', password = '000', port = '5432')
The following error
OperationalError Traceback (most recent call last) <ipython-input-3-28a442dcc7b2>in<module>() ---->1 conn = psycopg2.connect (host = '000', dbname ='sample', user ='postgres', password = '000', port = '5432') /usr/local/lib/python3.6/dist-packages/psycopg2/__init__.py in connect (dsn, connection_factory, cursor_factory, ** kwargs) 128 129 dsn = _ext.make_dsn (dsn, ** kwargs) ->130 conn = _connect (dsn, connection_factory = connection_factory, ** kwasync) 131 if cursor_factory is not None: 132 conn.cursor_factory = cursor_factory OperationalError: could not connect to server: Connection timed out Is the server running on host "000" and accepting TCP/IP connections on port 5432?
Cannot connect due to. I considered the following two possibilities
● The connection information may be incorrect
→ I was able to connect to postGIS with a password, user name and port number. [Deleted for resolution] (162c327211aaed9b62258e450fb6e160.png)
Also, for the host name, enter the IPv4 address confirmed by ipconfig at the command prompt! [Image description].
● There may be a problem on the SQL side
→ I wrote a script in SQL and saved and edited the data without any problem. Also, since it can be connected to POSTGIS, no problems have been found so far.
What could be the cause?
The image below is the SQL database information
Answer # 1
I selected the connection information in postGIS and checked which part of the connection information had the problem.
There was a problem with the IP because I couldn't connect only when I entered the IP.
- is it possible to connect to mysql of xampp started from another pc via wifi with a python application?
- readcsv error in python
- python - an error occurs in the if statement program that compares the size of numbers
- python - sklearn, svm error
- python - error in image binarization using cv2adaptivethreshold function
- python - in raspberry pi, the error occurs only in the case of the automatic start program using systemd
- python - categorical_crossentoropy error does not resolve
- python - (tensorflow) please teach me how to connect labels and indexes
- python - i want to display an image with pysimplegui, but an error occurs
- python - how to resolve attribute error
- python - error when scraping with selenium and firefox
- [python] graphviz output format error
- python - i get an error when connecting to a voice channel with discordpy
- python 3x - best estimator: i get an error with no syntax, so please tell me what to do
- [python] i don't know how to solve the error
- python - an error has occurred in yolo v3
- python - idle cannot resolve the "rootgeometry" error
- indent error doesn't go away, python
- error in import xlrd of python file from cakephp
- python : Peewee generates a faithful request, but turning to the database does not return anything, although if you insert this
- python : Insert Error: 7 Values for 8 Columns SQLite3.Operationalerror
- How to get a value from the column of the last row of the SQLite3 Python table?
- Python database request
- python : How to request birthdays dropping on the current and next week?
- why does not find a variable in another Python function