Forums

Database Password Changes not getting affected

I have created multiple databases but only the password related to username$default is the one that allows me access. I have changed password multiple times and saved it but the new password is not taking effect. My queries are

  1. Is there one to one relation between the Database Name and password or The Password is the same for all the databases.
  2. Password Change is not getting affected even after save
  3. Can I see the Database credentials anywhere in PythonAnywhere
  4. My $default password contains '@' but still able to go through without any special escape or encoding. I am using SQL Alchemy create_engine

conn_addr = 'mysql+mysqlconnector://' + user + ':' + passwd + '@' + host + ':' + port + '/' + db engine =create_engine(conn_addr, pool_recycle=280)

What kind of errors do you get?

Following Error for my database arguptaHello$Bandar [SQL] Connexion established mysql+mysqlconnector://arguptaHello:*@127.0.0.1:51102/arguptaHello$Bandar ============================================================================================ mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'arguptaHello'@'10.0.0.197' (using password: YES) ============================================================================================ but if I use the same password of username$default database the connection is established.

that port number is wrong, assuming you are doing this from PythonAnywhere

I am using sshtunnel to connect from outside of PythonAnywhere from my local machine.

Following is the code base: If I change db to arguptaHello$Bandar with password remaining the same it works but not with the new password that i had set.

host = '127.0.0.1'
user = 'arguptaHello'
passwd = '*****'
db = 'arguptaHello$default'
df = myhelpers.getFromDbFrame("jsondata_schedule")
with sshtunnel.SSHTunnelForwarder(
        ('ssh.pythonanywhere.com'),
        ssh_username='arguptaHello', ssh_password='******',
        remote_bind_address=('arguptaHello.mysql.pythonanywhere-services.com', 3306)
        ) as tunnel:
        port = str(tunnel.local_bind_port)
        conn_addr = 'mysql+mysqlconnector://' + user + ':' + passwd + '@' + host + ':' + port + '/' + db
        print("[SQL] Trying to connect to " + conn_addr)
        engine =create_engine(conn_addr, pool_recycle=280)
        dbConnection = engine.connect()
        df.to_sql("cbuzzjsonsched",dbConnection,if_exists='replace',index = False)
        print("INSERTED SUCCESSFULLY IN PYTHON ANYWHERE")

What do you mean by "password remaining the same" and the "new password"? What password are you talking about?

I am able to login to all the databases with the password set for arguptaHello$default. I changed the password and saved for arguptaHello$Bandar but that password does not allow me to connect .

@arguptaHello -- there is only one password for all databases, so if you change it, it will be changed for all of them.