I install the MySQL in my EC2 instance, then I give to root a password.
Now I'm trying to create an user to localhost domain and '%' domain too. It was fine to create the user:
CREATE USER 'valter'@'localhost' IDENTIFIED BY '******';
But when I try to grant it some privilegies :
GRANT ALL PRIVILEGES ON *.* TO 'valter'@'localhost' WITH GRANT OPTION;
Gives me the follow error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Here it says :
shell> mysql --user=root mysql If you have assigned a password to the root account, you will also need to supply a --password or -p option, both for this mysql command and for those later in this section.
But how it should look like the command then ?
What I'm doing wrong here ?
I would like to create an user that have access to localhost and external network too.
This is an issue with EC2, not MySQL. Here's a relevant forum entry:
The issue is that the RDS instance does not have superuser rights so I can't "grant all privileges" to any user.
I was able to get my application to work by creating the user with the specific rights that I need (insert, update,create, etc)
This forum discussion may also be worth looking through:
https://forums.aws.amazon.com/thread.jspa?threadID=64618