QuestionQ94

Database Security

You encounter an insufficient-privilege error during a long transaction.

The database administrator is notified and immediately grants the needed privilege:

GRANT UPDATE ON world.city TO ‘user1’;

How can you continue the transaction with the least interruption?

  • A Roll back the transaction and start the transaction again in the same session.
  • B Re-execute the failed statement in your transaction.
  • C Change the default database and re-execute the failed statement in your transaction.
  • D Close the connection, reconnect, and start the transaction again.
Explanation

A GRANT is applied immediately by MySQL, and table-level privilege changes become effective for an existing client session on its next request. The failed UPDATE can therefore be re-executed without rolling back the transaction, changing databases, or reconnecting.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!