I am trying to setup a MySQL server and when I went to create a second user it wouldn't give it permissions for the database. I can connect fine as long as I don't specify a database.
Access denied for user 'user'@'localhost' to database 'diddata'
The connection details are:
{ 'host' : 'localhost', 'user' : 'user', 'password' : 'password' , 'database': 'diddata' };
And to create the DB and table I did:
CREATE DATABASE IF NOT exists diddata;
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON user.* TO 'user'@'localhost';
Note that I've changed the username and password in this question.
I've already checked the privileges in MySQL workbench and they are there.
I found my mistake.
I noticed it when I went to change the database name in the question.