Ubuntu 16.04 only provides packages for MySql 5.7(by default) which has a range of backwards compatibility issues with code written against older MySql versions. for Rails specific see this
Oracle maintains a list of official APT repositories for MySql 5.