相关文章推荐
力能扛鼎的吐司  ·  Filtering by JSONB in ...·  3 月前    · 
坚强的手链  ·  How do you ...·  3 月前    · 
发呆的作业本  ·  Fast SQLAlchemy ...·  3 月前    · 
英俊的毛衣  ·  Connecting database ...·  3 月前    · 
活泼的铁链  ·  SQLAlchemy ...·  1 月前    · 
体贴的柿子  ·  安装apt-utils-掘金·  2 年前    · 
傲视众生的抽屉  ·  BootstrapTable ...·  2 年前    · 
失眠的鞭炮  ·  android - Glide ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

sqlalchemy root password with @ , show error (2003, "Can't connect to MySQL server on '16535@localhost' ([Errno 11003] [duplicate]

Ask Question
engine = sqlalchemy.create_engine('mysql+pymysql://root:Sakura%s@16535@localhost:3306/'+coin[x]) 

error

sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on '16535@localhost' ([Errno 11003] getaddrinfo failed)")

Any help? Thank you

Important

Percent encoding must be used for reserved characters in the elements of the URI-like string. For example, if you specify a string that includes the @ character, the character must be replaced by %40. If you include a zone ID in an IPv6 address, the % character used as the separator must be replaced with %25.

So the quick answer is to replace the @ symbol with %40. In general you can encode a string in a URI-safe manner as follows, working in Python:

import urllib.parse
encoded = urllib.parse.quote_plus(unencoded)