I'm assuming you mean a 5Mb limit on the size of the db?
If so, that would get done in MySQL when creating MySQL user accounts (not operating system user accounts) and is based on the privilege system. However, although you are able to grant the privilege of "create database", the "create database" syntax itself does not have a clause for limiting the growth of the db.
Someone correct me if I'm wrong here, but I didn't see anything in the MySQL manual for the "create database" syntax that would suggest otherwise.