Better check on DB version

- Improved DB version check to avoid "MySQL too old" when it's not too old
- removed unused function