Aurora MySQL 5.6 undesired automatical creation of a new user when running EF Core migrations


I'm using Aurora MySQL 5.6 with my application, in which I use EF Core (2.1) as ORM. I run the migrations from my TeamCity build server.

The migrations are executed by a user 'tc-user'@'%' that is identified by a password and has a set of permissions to change the schema, etc. The connection string is pulled from AWS SSM parameter store.

Sometimes running the migrations dotnet ef database update fails, with an error message

An error occurred using the connection to database '' on server ''.
MySql.Data.MySqlClient.MySqlException (0x80004005): Access denied for user 'tc-user'@'' (using password: YES)

When this happens I found that there's a new user created with no password or permissions in that database - 'tc-user'@''.

If I delete that user - the migrations pass. But once in a while this happens again, and lately it has been happening more often. This happens on multiple clusters as well.

Sometimes, when there's more than 1 migration in the build it will execute some and then break.

Why is it creating that user?

I tried setting the same password on the new user and giving it the same permissions as the main one, but the migrations still fail. So having both users doesn't seem to be an option either.

asked on Stack Overflow Mar 14, 2020 by LLL • edited Mar 14, 2020 by LLL

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0