Fix bugs when using MySQL as index database

1. MySQLdb will raise `ProgrammingError` if table doesn't exists. Use `engine.has_table` to check whether table exists for compatible
2. VARCHAR requires a length on dialect mysql. String length limit is according to [Docker Hub's limit](https://registry.hub.docker.com/account/repositories/add/)