Secsh 通道 0 打开失败:打开失败:管理上禁止的 pythonanywhere
Secsh channel 0 open FAILED: open failed: Administratively prohibited pythonanywhere
我正在尝试连接到 pythonanywhere.com
上托管的 MySQL 数据库
但它低于错误
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')
我的文件是
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()
这需要付费帐户才能在 PythonAnywhere 上使用 SSH(包括 SSH 隧道)。
我正在尝试连接到 pythonanywhere.com
上托管的 MySQL 数据库
但它低于错误
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')
我的文件是
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()
这需要付费帐户才能在 PythonAnywhere 上使用 SSH(包括 SSH 隧道)。