Issue with creating mysql user in AWS
Zagurim
Posts: 1 New member
When I create a user in mysql manually, like
CREATE USER 'user'@'%' IDENTIFIED BY 'password';
GRANT ALL ON database.* TO 'user'@'%';
FLUSH PRIVILEGES;
My user can conenct to the database from the remote server
When i do the same from flyway however, my user cannot connect.
Just wondering if there is something stupid I am missing here?
Flyway versions tried were 7.15.0 and 10.10.0 and mysql in AWS version 5.7.
CREATE USER 'user'@'%' IDENTIFIED BY 'password';
GRANT ALL ON database.* TO 'user'@'%';
FLUSH PRIVILEGES;
My user can conenct to the database from the remote server
When i do the same from flyway however, my user cannot connect.
Just wondering if there is something stupid I am missing here?
Flyway versions tried were 7.15.0 and 10.10.0 and mysql in AWS version 5.7.
Tagged:
Answers
Thank you reaching out on the Redgate forums regarding your Flyway / MySQL query.
When you say you are doing the same in Flyway, can you confirm how you are doing it - via a migration to create the user?
I would be expecting a process similar to this, depending on if you are setting up other users/objects etc
When creating scripts, it’s crucial these scripts are idempotent and error-free. E.G.:
Run the migration in Flyway
When runningFlyway migrate
, pay attention to the logs for any errors or warnings that could indicate what went wrong:Check MySQL User Connection
After running your migrations, test the connection as the newly created user:Possibly AWS Specific Settings
You mention using AWS - some areas to check here include:Alternate testing - Testing Connection Locally
Try to mimic the Flyway operations manually via a script or the MySQL command line, exactly as Flyway would execute them:This would be the starting point to try and flush out where any issues/errors may be occurring in your configuration.
Any messages at these points should help start to find where the process is falling down for you