OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Connecting to PostgreSQL Database with Password Containing ‘@’ Character (using jupyter notebook)

  • Thread starter Thread starter Hrishi Chougule
  • Start date Start date
H

Hrishi Chougule

Guest
I’m trying to connect to my PostgreSQL database using SQLAlchemy, but I’m encountering an issue due to my password containing the ‘@’ character. The problem arises because the ‘@’ symbol is also used in the connection string syntax. How can I properly format the connection string to handle this situation? Any help would be greatly appreciated!

Code:
%load_ext sql
from sqlalchemy import create_engine
%sql postgresql://postgres:xxxxx@yyyyy@localhost:5432/ABC

this is the error i am getting -

Connection info needed in SQLAlchemy format, example: postgresql://username:password@hostname/dbname or an existing connection: dict_keys([]) No module named 'psycopg2' Connection info needed in SQLAlchemy format, example: postgresql://username:password@hostname/dbname or an existing connection: dict_keys([])

The Database is - ABC The Password is - xxxx@yyyy (format)

How do i access this database in my jupyter notebook (Python) ?
<p>I’m trying to connect to my PostgreSQL database using SQLAlchemy, but I’m encountering an issue due to my password containing the ‘@’ character. The problem arises because the ‘@’ symbol is also used in the connection string syntax. How can I properly format the connection string to handle this situation? Any help would be greatly appreciated!</p>
<pre><code>%load_ext sql
from sqlalchemy import create_engine
%sql postgresql://postgres:xxxxx@yyyyy@localhost:5432/ABC
</code></pre>
<p>this is the error i am getting -</p>
<p>Connection info needed in SQLAlchemy format, example:
postgresql://username:password@hostname/dbname
or an existing connection: dict_keys([])
No module named 'psycopg2'
Connection info needed in SQLAlchemy format, example:
postgresql://username:password@hostname/dbname
or an existing connection: dict_keys([])</p>
<p>The Database is - ABC
The Password is - xxxx@yyyy (format)</p>
<p>How do i access this database in my jupyter notebook (Python) ?</p>
 
Top