使用mysql-python仅连接到我的路由器,而不连接到我的远程服务器 [英] using mysql-python only connects to my router, not my remote server

查看:76
本文介绍了使用mysql-python仅连接到我的路由器,而不连接到我的远程服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在模块上使用python:MySQLdb我试图连接到远程mysql服务器...

using python with module: MySQLdb I attempt to connect to a remote mysql server...

conn = mdb.connect('mysql.remotehost.com', 'username', 'password', 'database')

不是尝试建立与mysql.remotehost.com的连接,而是出现此错误:

rather than try and make the connection to mysql.remotehost.com I get this error:

_mysql_exceptions.OperationalError: (1045, "Access denied for user 'username'@'xx.x.xxx.xxx' (using password: YES)")

其中xx.x.xxx.xxx是我的调制解调器/路由器的IP地址.为什么会这样?如何解决它才能实际访问我的远程mysql主机?

where the xx.x.xxx.xxx is the ip address of my modem/router. Why does this happen? How can I get around it to actually access my remote mysql host?

推荐答案

好像您没有权限从主机xx.x.xxx.xxx访问MySQL.您需要向用户授予访问权限.

Looks like you don't have permission to access MySQL from host xx.x.xxx.xxx. You need to grant access to the user.

这篇关于使用mysql-python仅连接到我的路由器,而不连接到我的远程服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆