the implementation for MySQL