Page 1 of 1

MySQLdb python connection using non-root account?

Posted: Mon Oct 17, 2016 7:12 pm
by cscuilla
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

Re: MySQLdb python connection using non-root account?

Posted: Mon Oct 17, 2016 8:51 pm
by DougieLawson
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.