Forums

2023-11-22 17:13:13,949| ERROR | Secsh channel 0 open FAILED: open failed: Administratively prohibited 2023-11-22 17:13:13,950| ERROR | Could not establish connection from local ('127.0.0.1', 65516) to remote ('Rajanosha7.mysql.pythonanywhere-services.

HI I have PAID ACCOUNT BUT STILL I M GETTING THIS ERROR HELP ME RESOLVE IT. BEFORE IT WAS WORKING FINE

def get_db_data():
    import mysql.connector
    import sshtunnel

    sshtunnel.SSH_TIMEOUT = 5.0
    sshtunnel.TUNNEL_TIMEOUT = 5.0

    with sshtunnel.SSHTunnelForwarder(
            ('ssh.pythonanywhere.com'),
            ssh_username='myuser', ssh_password='mypasswod',
            remote_bind_address=('Rajanosha7.mysql.pythonanywhere-services.com', 3306)
    ) as tunnel:
        connection = mysql.connector.connect(
            user='Rajanosha7',
            passwd='mypasswoddb',
            host='127.0.0.1', port=tunnel.local_bind_port,
            db='Rajanosha7$olinsure_db',
        )
        # Do stuff
        mycursor = connection.cursor()
        mycursor.execute("SELECT * FROM medicare_data WHERE  posted=0 ")
        # mycursor.execute("UPDATE medicare_data SET systemz=13 WHERE m_id>=23400 and m_id<26400 and posted=0 ")
        # mycursor.execute("SELECT ip FROM ips WHERE ip_time IS NOT NULL; ")#18555
        resultsz = mycursor.fetchall()
        connection.close()
        print(resultsz)
        print(len(resultsz))
        return resultsz
get_db_data()

[edit by admin: formatting]

Hi there -- it looks like we should have emailed you about this; we'll do that now.