I have just installed mysql on Mac OSX and can easily open it in a shell and gain access to the databases and tables that come with it.
Now I want to create a database in Python using mysql-connector/python
Before doing that I figured it would be wise to set a user name and password in mysql.
I have tried using the following but get error messages. My GOAL is to set a user name and a password so that I may simply provide it to mysql-connector for python, and ultimately execute sql queries from the python environment. Here is what I tried at the mysql command prompt:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
And I get the error message:
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
So I tried the UPDATE METHOD:
UPDATE mysql.user SET Password = PASSWORD('newpwd') WHERE User = 'root';
and I get the error message:
ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user'
So does anyone know why I get denied and how I can make the changes to create a user and a password that I may ultimately use in mysql connect in the python environment?