This wouldn't be related to security groups. Your RDS instance isn't actually aware of them -- they only control access to the host running the RDS instance at the TCP layer, in the AWS network.
Regarding your issue -- I think what you'll find is that you somewhere along the line actually did manage to create the user:
mysql> CREATE USER 'stackoverflow'@'%';
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE USER 'stackoverflow'@'%';
ERROR 1396 (HY000): Operation CREATE USER failed for 'stackoverflow'@'%'
mysql> CREATE USER 'stackoverflow';
ERROR 1396 (HY000): Operation CREATE USER failed for 'stackoverflow'@'%'
mysql>
To see the user accounts on the server SELECT * FROM mysql.user;
.
Note that user 'stackoverflow'
and 'stackoverflow'@'%'
refer to the same user, where @'%'
means the user's login privilege is not restricted by source IP address or host by MySQL (it can and will still be restricted by the security group settings, as I'll show in some more detail, below).
The mysql.user
table contains all of the accounts the server knows about. This table (and several other grant tables) can be manipulated manually, but it's best to use the GRANT
, REVOKE
, CREATE USER
, and DROP USER
statements.
Potentially helpful later... if you do set up the security group in such a way that you can't connect to the server (because your source IP address isn't permitted) this will not cause any behavior change on the part of MySQL -- your connection will simply time out, never actually reaching the server, regardless of username and password.
It's a common error you'll see entirely too many people making (including here on SO) to start dinking around with permissions on the server, when they encounter this specific problem -- don't do that -- the problem is always one of network connectivity if you see exactly the following behavior:
$ mysql -h my-rds-with-security-group-too-restrictive.jozxyqk.us-west-2.rds.amazonaws.com
ERROR 2003 (HY000): Can't connect to MySQL server on 'my-rds-with...' (110)
ERROR 2003
can mean several things... but the money is at the end of the line. That code (110)
at the end is telling you you're never reaching the server -- it's not a permissions issue, if you see this exact code code. Look it up:
$ perror 110
OS error code 110: Connection timed out
(Linux error code 110
shown; Mac is probably the same code, since I suspect it's a standard POSIX error code, while Windows makes up their own. I believe it's 10060
on Windows that conveys the same meaning.)