【问题标题】:Secsh channel 0 open FAILED: open failed: Administratively prohibited pythonanywhereSecsh 通道 0 打开失败:打开失败:管理禁止 pythonanywhere
【发布时间】:2021-12-06 07:49:34
【问题描述】:

我正在尝试连接到托管在 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()

【问题讨论】:

  • 隧道已在您尝试使用的 ssh 服务器上禁用。这是共享内容的正确配置。
  • 您需要付费帐户才能在 PythonAnywhere 上使用 SSH(包括 SSH 隧道)。

标签: python mysql pythonanywhere


【解决方案1】:

这需要付费帐户才能在 PythonAnywhere 上使用 SSH(包括 SSH 隧道)。

【讨论】:

    猜你喜欢
    • 2018-05-29
    • 2018-01-15
    • 2016-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-06
    • 2018-09-16
    • 1970-01-01
    相关资源
    最近更新 更多