I was trying to access the database from my python program by:
db = mysql.connect(host = 'localhost', user = 'Max', passwd = 'maxkim', db = 'TESTDB')
cursor = db.cursor()
But, I get an error message in the first line of code.
OperationalError: (1045, "Access denied for user 'Max'@'localhost' (using password: YES)")
To remedy the situation, I did the following:
$ mysql -u Max-p
Enter password: maxkim
mysql> create database TESTDB;
mysql> grant usage on *.* to Max@localhost identified by ‘maxkim’;
mysql> grant all privileges on TESTDB.* to Max@localhost ;
mysql> exit
If I have granted all access to the the database for the user "Max" (me), why can't I still connect in python?