我正在尝试将数据上传到MySQL数据库,但我遇到了麻烦。我尝试运行代码时收到的错误是2003, Can't connect to MySQL server on 'db_host' ([Errno 11001] getaddrinfo failed)
。有谁知道这个错误意味着什么或如何解决它?我在下面提供了我的代码。
import pymysql
import time
import good_morning as gm
DB_HOST = 'db_host'
DB_USER = 'db_user'
DB_PASS = 'db_pass'
DB_NAME = 'db_name'
conn = pymysql.connect(host=DB_HOST, user=DB_USER, passwd=DB_PASS, db=DB_NAME)
kr = gm.KeyRatiosDownloader()
fd = gm.FinancialsDownloader()
kr_frames = kr.download('AAPL', conn)
fd_frames = fd.FinancialsDownloader()