I accidentally enabled ONLY_FULL_GROUP_BY mode like this:
SET sql_mode = \'ONLY_FULL_GROUP_BY\';
How do I disable it?
This is a permanent solution for MySql 5.7+ on Ubuntu 14+:
$ sudo bash -c "echo -e \"\nsql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\" >> /etc/mysql/mysql.conf.d/mysqld.cnf"
$ sudo service mysql restart
# Check if login attempt throws any errors
$ mysql -u[user] -p # replace [user] with your own user name
If you are able to login without errors - you should be all set now.