Reputation: 1424
I have added migrations to our TypeORM based backend and all works fine locally with the following settings in the ormconfig:
synchronize: false,
migrations: ['src/migrations/*{.ts,.js}'],
cli: {
migrationsDir: 'src/migrations',
},
migrationsRun: true,
when making this connection to our google cloudsql databases I get this error.
QueryFailedError: ER_SPECIFIC_ACCESS_DENIED_ERROR: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
It seems that GCP won't allow up to set the user with SUPER privileges so does anyone know how to make TypeORM connect, with migrations true, and not have this requirement?
Upvotes: 0
Views: 467
Reputation: 331
Its true GCP does not allow users with SUPER privileges. Here is the documentation for the error you are seeing.
The issue might be There could be an event, a view, a function, or a procedure in the dump file using super user@localhost (such as root@localhost). This is not supported by Cloud SQL.
Per official documentation you may find a proper workaround by using DEFINER clauses here.
Some users here reported that they found a workaround by deleting DEFINER clauses from MYSQL.
Upvotes: 2