sparse-intern-71089
01/13/2021, 8:29 PMbillowy-army-68599
tall-winter-40504
01/13/2021, 8:32 PMdb_user = mysql.User(
resource_name="db-user",
user="actualuser",
plaintext_password=secret_from_config,
host=rds_instance.address,
opts=mysql_opts)
where mysql_opts
is:
mysql_provider = mysql.Provider(
resource_name="db-provider",
endpoint=rds_instance.endpoint,
username=rds_instance.username,
password=config_secret,
)
mysql_opts = pulumi.ResourceOptions(provider=mysql_provider)
tall-winter-40504
01/13/2021, 8:34 PMadmin
account and I can successfully use it to connect to the db and run sql commands using the mysql
CLI
Doing sth like this to connect:
mysql -h <http://somelongstring.us-west-2.rds.amazonaws.com|somelongstring.us-west-2.rds.amazonaws.com> -u admin -p
tall-winter-40504
01/13/2021, 8:34 PMmysql
library additional statements that I’m having trouble with.tall-winter-40504
01/13/2021, 8:36 PMselect user from mysql.user;
I even see the username actualuser
in the results printed however when I try to log-in with that same mysql
CLI I typed above I get Access Deniedtall-winter-40504
01/13/2021, 8:38 PMadmin
user and the CLI as I mentioned above and manually create a new user I have no problem granting them permissions or then using that new user with the CLI to connect back to the db…
Just the user created through Pulumi mysql provider that is having issues.billowy-army-68599
plaintext_password
- that takes a string, and your secret_from_config
will actually be an output, so you may need to wrap it in an apply. Can you verify it's that by setting plaintext_password
manually?tall-winter-40504
01/13/2021, 9:46 PMmysql
CLI to access the db with that user due to Access Deniedbillowy-army-68599
billowy-army-68599
db_user = mysql.User(
resource_name="db-user",
user="actualuser",
plaintext_password=secret_from_config,
host=0.0.0.0,
opts=mysql_opts)
billowy-army-68599
tall-winter-40504
01/13/2021, 11:19 PMtall-winter-40504
01/13/2021, 11:19 PMtall-winter-40504
01/13/2021, 11:21 PM0.0.0.0
suggestion 😛tall-winter-40504
01/13/2021, 11:24 PMtall-winter-40504
01/13/2021, 11:25 PMgrant
was the other smoking gun I found in the logstall-winter-40504
01/13/2021, 11:28 PMtall-winter-40504
01/13/2021, 11:29 PM%
nexttall-winter-40504
01/13/2021, 11:30 PMtall-winter-40504
01/13/2021, 11:46 PMgrant=True
after alltall-winter-40504
01/13/2021, 11:47 PMtall-winter-40504
01/13/2021, 11:47 PMtall-winter-40504
01/13/2021, 11:47 PMtall-winter-40504
01/13/2021, 11:48 PMmysql> show grants for webserver;
+---------------------------------------------------------+
| Grants for webserver@% |
+---------------------------------------------------------+
| GRANT PROCESS ON *.* TO `webserver`@`%` |
| GRANT ALL PRIVILEGES ON `databasename`.* TO `webserver`@`%` |
+---------------------------------------------------------+
2 rows in set (0.03 sec)
mysql> show grants for webserver;
+---------------------------------------+
| Grants for webserver@% |
+---------------------------------------+
| GRANT USAGE ON *.* TO `webserver`@`%` |
+---------------------------------------+
1 row in set (0.03 sec)