我正在尝试从我自己的计算机连接到我的网站的MySQL数据库。我使用的脚本:
hostaddress = 'sitedezign.net'
username = '*********'
password = '*********'
database = '*********'
db_port = 3306
#connect
db = _mysql.connect(host=hostaddress,user=username,passwd=password,db=database, port=db_port)
但是我收到以下错误
Traceback (most recent call last):
File "C:\Users\Yorian\Desktop\TU\Stage Shore\python_files\Rectify, metadata and upload\sql_test.py", line 25, in <module>
port=db_port)
OperationalError: (2003, "Can't connect to MySQL server on 'sitedezign.net' (10061)")
服务器来自webhoster,因此我无法自行访问服务器。
任何有想法出错的人?