Reputation: 2428
I am able to connect through the below command and see the databases. But unable to run migration or create tables which results in below error.
Command
mysql -h endpoint.rds.amazonaws.com -u admin -p
Error
SQLSTATE[HY000] [1045] Access denied for user 'admin'@'MY-IP' (using password: YES)
(SQL: select * from information_schema.tables
where table_schema = storydb and table_name = migrations and
table_type = 'BASE TABLE')
Queries from MySql command line
show databases;
+--------------------+
| Database |
+--------------------+
| storydb |
| information_schema |
| mysql |
| performance_schema |
+--------------------+
select user, host, plugin from mysql.user;
+------------------+-----------+-----------------------+
| user | host | plugin |
+------------------+-----------+-----------------------+
| admin | % | mysql_native_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sha2_password |
| rdsadmin | localhost | mysql_native_password |
+------------------+-----------+-----------------------+
Configuration
Upvotes: 1
Views: 8722
Reputation: 184
For those using SSL - RDS (check configuration -> Encryption (enabled)
mysql -h mysqldb.abcd.us-west-2.rds.amazonaws.com --ssl-ca=global-bundle.pem -P 3306 -u myuser --password=$TOKEN
More info on how to generate the token and the bundles : https://aws.amazon.com/premiumsupport/knowledge-center/rds-mysql-access-denied/
Upvotes: 0