0
我試着使用Peewee與sshtunnel連接到遠程MySQL數據庫:我可以用sshtunnel使用Python Peewee嗎?
with SSHTunnelForwarder(
('server.pt', 9922),
ssh_password="pass_ssh",
ssh_username="user_ssh",
remote_bind_address=('localhost', 3306)) as server:
myDB = pw.MySQLDatabase("dbname", user="db_user", passwd="db_pass")
但我得到一個錯誤
OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)")
你能幫助我嗎?