Forums

Secsh channel 0 open FAILED: open failed: Administratively prohibited

I was following the Accessing your MySQL database from outside PythonAnywhere guidelines and i am getting the error below

2021-10-19 13:02:38,943| ERROR   | Secsh channel 0 open FAILED: open failed: Administratively prohibited
2021-10-19 13:02:38,943| ERROR   | Could not establish connection from local ('127.0.0.1', 62213) to remote ('lewisMachilika.mysql.pythonanywhere-services.com', 3306) side of the tunnel: open new channel ssh error: ChannelException(1, 'Administratively prohibited')

Below is my file

import MySQLdb
import sshtunnel

sshtunnel.SSH_TIMEOUT = 5.0
sshtunnel.TUNNEL_TIMEOUT = 5.0

with sshtunnel.SSHTunnelForwarder(
    ('ssh.pythonanywhere.com'),
    ssh_username='xxxxx', ssh_password='xxxxxx',
    remote_bind_address=('xxxxxxxx', 3306)
) as tunnel:
    connection = MySQLdb.connect(
        user='xxxxxx',
        passwd='xxxxx',
        host='127.0.0.1', port=tunnel.local_bind_port,
        db='xxxxxx',
    )
    # Do stuff
    connection.close()

You have a free account. That only works on paid accounts.

I started to have the same problem. I had been using this method for over a year now with my paid account but today it stopped working...

edit: double post, sry

Yes I am also having the same problem, was working fine until about 2 hours ago

Are you specifically getting an "Administratively prohibited" error, or something else?

Update: if you were getting timeouts rather than that specific error, it may have been due to the load on one of our SSH servers -- it was being hit quite hard earlier on today, but should be fine now.

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

I've responded in other forum thread where you posted about this.

Hello, I'm having the same problem. The normally working code has not been working for about 2 days. Previously, I was only getting a timeout error and it was fixed when I waited a little bit. However, now the "Administratively prohibited" error appears and no matter what I do, it doesn't fix it. Please help, it's already a working product and right now I'm going to start having problems with my customer side. I have had a Paid account for 1 year and still do.!

Hi there, I can see that we've emailed you a couple times recently about your code effectively ddosing the database service. Could you take a look at the email. Searching your inbox for PythonAnywhere in in the subject should bring it up

Yeah, I noticed that and briefly explained what happened and how to prevent it in the future. That was not intentional and waiting for a response from mail.