Can’t Log In to Gallery2

I could not log in to Gallery2 from either my account or the admin account. This is the error (only shown when logging in to admin):

in modules/core/classes/GallerySession.class at line 712 (GalleryCoreApi::error)
in modules/core/classes/GallerySession.class at line 322 (GallerySession::_acquireNewPersistentSession)
in modules/core/classes/GallerySession.class at line 513 (GallerySession::start)
in modules/core/classes/helpers/GalleryUserHelper_medium.class at line 362 (GallerySession::regenerate)
in modules/core/classes/helpers/GalleryEventHelper_simple.class at line 59 (GalleryUserHelper_medium::handleEvent)
in modules/core/classes/GalleryCoreApi.class at line 2238 (GalleryEventHelper_simple::postEvent)
in modules/core/ at line 143 (GalleryCoreApi::postEvent)
in main.php at line 250 (UserLoginController::handleRequest)
in main.php at line 104
in main.php at line 88

A little Googling turned up this error message with the cause being two user accounts with the same email address. To check, I logged in to the MySql server from the command line:
mysql -u {admin} -p -h mysql.{mysite}.com gallery2

show tables;
select * from g2_user;

No two users had the same email address. Another post mentioned a corrupt session map table. So:

select * from g2_SessionMap;

Sure enough, MySql complained the table had been marked “crashed”. Next:

check table g2_SessionMap;
repair table g2_SessionMap;

And that was it!