from getpass import getpass
try:
print("login MySQL")
with connect(
host="localhost",
user=input("user_name: "), # user_name: root
password=getpass(prompt='Password: ', stream=None),
# password=input("pass:"),
database="python_db"
) as connection:
print("connected well")
print(connection)