Implements mysql functionality.