postgresql - Trouble connecting to SQL database in Jupyter Notebook
问题描述
I'm having trouble connecting to a SQL database in Juptyer Notebook.
I have changed the port to match the port on my computer (because it was not the default).
dbconn = psycopg2.connect(dbname='mimic',user=[hidden], host='localhost', password=[hidden], port=5433)
I'm using the exact username and password I use to login into the database online, so I expect it to successfully set up the connection, however Jupyter Notebook keeps giving me an Operational Error:
~\AppData\Local\Continuum\anaconda3\lib\site-packages\psycopg2\__init__.py in connect(dsn, connection_factory, cursor_factory, **kwargs)
124
125 dsn = _ext.make_dsn(dsn, **kwargs)
--> 126 conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
127 if cursor_factory is not None:
128 conn.cursor_factory = cursor_factory
OperationalError: FATAL: password authentication failed for user
解决方案
推荐阅读
- javascript - 了解初学者的循环冗余码算法
- css - 媒体查询/在弹出窗口和桌面上应用 CSS 的任何其他解决方案
- r - 将“Factoextra”和“corrplot”的图合并到一个图中
- reactjs - Redux Thunk vs Redux 自定义中间件
- python - Tkinter 冲洗按钮彼此相邻
- c# - 如何在 UWP App 中播放 ListView 中的选定歌曲
- python - 在 networkx/plotly 网络和标签上间隔节点
- flutter - 如何将用户名等信息保存到设备中?
- javascript - 未调用nodejs护照回调
- apache-spark - 删除数据框列的某些部分