cscuilla
Posts: 58
Joined: Tue Apr 26, 2016 6:35 pm

MySQLdb python connection using non-root account?

Mon Oct 17, 2016 7:12 pm

I can connect successfully to my DB using my root account through MySQLdb.

Code: Select all

db = MySQLdb.connect("192.168.1.664", "root", "MyRootPassword", "piclock")
I made a new user account (webguy) w/ only SELECT, INSERT, and UPDATE priveledges, but the connection fails with the following message..

Code: Select all

_mysql_exceptions.OperationalError: (1045, "Access denied for user 'webguy'@'192.168.1.204' (using password: YES)")
The same account (webuy) works fine with my php connection, but not with the python connection

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MySQLdb python connection using non-root account?

Mon Oct 17, 2016 8:51 pm

Grab the perl script from the comments at: http://dev.mysql.com/doc/refman/5.7/en/show-grants.html and run that. It will show exactly what privileges you've granted.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Python”