I have a new mysql installation and am trying to create a separate user to have have access to their own database.
mysqladmin -u root -p create people
mysql> create user 'cgp'@'localhost' identified by 'myPass';
mysql> grant all on people to 'cgp'@'localhost' identified by 'myPass';
Query OK, 0 rows affected (0.00 sec) <-- problem here?
mysqladmin -v -u root -p flush-privileges
mysql -h localhost -u cgp -p people
Enter password:
ERROR 1044 (42000): Access denied for user 'cgp'@'localhost' to database 'people'
mysql -u root -p
mysql> show grants;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*xxx' WITH GRANT OPTION
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
As you can see there is nothing in the Grant table for the cgp user. What am I doing wrong?
Try
grant all on people.* to 'cgp'@'localhost' identified by 'myPass';