Tolerating SQL errors (orderby not in distinct, select not in group by) in MySQL 5.7.13 vs 5.7.11 This question is related to the following 2 SQL errors (line breaks added by me)

MySql.Data.MySqlClient.MySqlException (0x80004005):
Expression #2 of ORDER BY clause is not in SELECT list, references column 'auitool2014.a.prog' which is not in SELECT list;
this is incompatible with DISTINCT


MySql.Data.MySqlClient.MySqlException (0x80004005): 
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'H.C51' which is not functionally dependent on columns in GROUP BY clause; 
this is incompatible with sql_mode=only_full_group_by


My problem is simple to describe, even without posting the original SQL. I have a Mysql 5.7.11-log server running on Windows in which I can SELECT A,B GROUP BY A and SELECT DISTINCT A,B ORDER BY C without any problem. Yes, this is wrong from the SQL point of view.

But it works and customers are happy. It will never be fixed be fixed in the future.

We just installed a fresh standard Mysql 5.7.13-log on Linux using Yum. Now all queries containing such errors break.

I have looked around and it seems that Mysql team did some work about improper GROUP BYs. I have tried to disable full group bys but then I am left with the distinct issue.

I have also tried to replicate part of the Mysql configuration from the Windows box but returned again to both issues.

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 


I just want to know how do I tell the new Mysql 5.7.13 to behave exactly like the (bugged?) version 5.7.11. We will try to install the exact 5.7.11 from Yum but it could take a considerable while. So to be more clear: how do I get rid of those two errors, humbly given that the SQL statements need to be eventually fixed?
Not quite what you are saying:

5.7.5 changelog says

"Queries of the form SELECT DISTINCT col1 ... ORDER BY col2 qualify as forbidden by SQL2003 (hidden ORDER BY columns combined with DISTINCT), but were not rejected with the ONLY_FULL_GROUP_BY SQL mode enabled. "

Perhaps you should plea to bugs.mysql.com for a 'mode' to violate SQL2003 on the grounds that there is no way to get what you want.