On my AWS RDS Mysql 8.0.16 server I have one DB (my-db
) and 2 users: the master
user (created automatically by RDS) and an app user created by me:
create user if not exists `appuser`@`%` identified by 's3cr3t';
grant all on `my-db`.* to `appuser`@`%`;
When I run the delete from Things where id = 123
query on behalf of the appuser
, the error message I get is:
[23000][1217] Cannot delete or update a parent row: a foreign key constraint fails
(1217 and no constraint details)
When I run the same query as a master user, the error message is:
[23000][1451] Cannot delete or update a parent row: a foreign key constraint fails (
my-db
.Sandwiches
, CONSTRAINTSandwichesThingIdFK
FOREIGN KEY (thingId
) REFERENCESThings
(id
))
(1451 and there are constraint details)
How do I make appuser
get 1451 and all the details?