我正在尝试将 Python 应用程序与在线数据库连接起来。它在 localhost 数据库上正常工作,但是当我尝试在线连接时显示错误。
错误
errno=2003, values=(self.get_address(), _strioerror(err)))
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on '69.162.107.34:3306' (10060 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)
代码
import mysql.connector
mydb = mysql.connector.connect(
host="00.00.00.00",
user="user",
passwd="pass",
database="db"
)
mycursor = mydb.cursor()
最佳答案
先连接你的工作台再试一次
https://stackoverflow.com/questions/54830916/
相关文章:
reactjs - 找不到模块 : Can't resolve 'react-native'
spring-boot - Liquibase 和 Hibernate ddl-auto=updat
python - “Tensor”对象不能使用 Keras 和 seq2seq 模型调用
vue.js - 如何处理具有多个参数(例如表格数据)的查询的 Apollo 缓存更新
java - 带有 Thymeleaf 的 IntelliJ (2018.3) - 静态内容路径上没
angular-material2 - Angular Material2 Mat-Table服务器