I wish to set the maximum number of connections to my mysql database to 1, so that only one person can be logged in at once. I am trying to do this by setting the max_connection variable to 1, however it still allows be to gain 2 connections before I get a Error 1040: too many connections.

Why does it allow 2 connections?

How do I make it only accept only 1?