ITKeyword,专注技术干货聚合推荐

注册 | 登录

Python mysql connector access denied error

itPublisher 分享于

2020腾讯云10周年活动,优惠非常大!(领取2860元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1040

2020阿里云最低价产品入口,含代金券(新老用户有优惠),
地址https://www.aliyun.com/minisite/goods

推荐:Mysql5.6 + Python 3.3遇到问题“ImportError: No module named 'mysql.connector'; mysql is not a package”

装了 Mysql5.6 和 Python3.3 后,试了下面代码: 结果出现下面的错误: mysql 的环境变量已经设置好,如图,但是问题还在。最后发现是文件名的问题,.py文件不能

I've read everything possible and I just can't connect to my mysql server. Here is my code. very simple. (I used xxx to hide all the private info. everything else is the way i got it.

import mysql.connector

conn = mysql.connector.connect(user='xxxx',password='xxxxx',host='xxxx',db='xxx',port=3306)

The login info is definitely correct. I tried it in a mysql client and it connected just fine. The MySQL server is hosted on dreamhost. I set the allowable IPs for the db user to wildcard %.%.%.% so anyone could connect.I don't know what else could possibly be wrong. When I try to connect in python i get:

C:\Python33\python.exe D:/Dropbox/python/v2/test.py
Traceback (most recent call last):
  File "D:/Dropbox/python/v2/test.py", line 3, in <module>
    conn = mysql.connector.connect(user='xxx',password='xxx',host='xxx',db='xxx',port=3306)
  File "C:\Python33\lib\site-packages\mysql\connector\__init__.py", line 101, in connect
    return MySQLConnection(*args, **kwargs)
  File "C:\Python33\lib\site-packages\mysql\connector\connection.py", line 117, in __init__
    self.connect(**kwargs)
  File "C:\Python33\lib\site-packages\mysql\connector\connection.py", line 383, in connect
    self._open_connection()
  File "C:\Python33\lib\site-packages\mysql\connector\connection.py", line 350, in _open_connection
    self._ssl)
  File "C:\Python33\lib\site-packages\mysql\connector\connection.py", line 176, in _do_auth
    raise errors.get_exception(packet)
mysql.connector.errors.ProgrammingError: 1044 (42000): Access denied for user 'xxx'@'%.%.%.%' to database 'xxx'

Any help would be greatly appreciated.

推荐:mysql错误 (ERROR 1045 (28000): Access denied for use)的解决

ERROR 1045 (28000): Access denied for user 'xcj'@'localhost' (using password: YES) mysql出现这样的错误可以这样解决: 1. 以root用户登录 2. use mysql; 3

python mysql connector
|
  this question
asked Jul 30 '14 at 16:19 Avovk 145 2 11

 | 

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

推荐:mysql -uroot -p ; access denied

imeadmin@imeadmin:~/redmine-2.4.1-1/mysql$ bin/mysql  -uroot -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using p


相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。