Improved database checking (in MySQL at least)

Signed-off-by: margarett <bruno.m.alves@gmail.com>