Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MYSQL: "Access denied for user 'X'@'localhost' (using password: YES)" PYTHON

Tags:

I'm trying to access the database using python but it's just not working. When I access a remote database everything is fine. But local there is some kind of problem. What I'm doing wroing here? I've tryied some things that I found on intener do grant access but they did not work

Local users: enter image description here

Code used:

enter image description here

Message recieved

enter image description here

Thanks for the help

like image 868
Xidh Avatar asked Oct 24 '16 11:10

Xidh


1 Answers

After hours of testing I finally found out what was the problem! After some alterations in the mysql users and no results everything work just fine when I added the PORT to mysql database!

db = MySQLdb.connect(host="127.0.0.1",user="userpython",passwd="root",db="bigdata",port=8886)
like image 144
Xidh Avatar answered Sep 23 '22 16:09

Xidh