Linux CentOS MySQL 5.7
MySQL “Order By Clause” Not Working with “SELECT DISTINCT and ORDER BY” after MySQL Update to 5.7
April 8, 2021
0
, , ,

I have recently updated our MySQL server to MySQL 5.7.
Then I have found that in all the projects that has “SELECT  DISTINCT and ORDER BY” SQL statements, are not working anymore.

In Order to Fix that I followed the below procedure:
Logged in To Server (CentOS 7).
In console mode typed

# mysqld –help –verbose
Then it gave something like that “/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf ”
So, now I know that mysql main configuration file is at “/etc/my.cnf/

Then run again in the console mode:
# nano /etc/my.cnf

my.conf_v1

Then I updated it with:my.conf_v2

Basically I added:
sql_mode = ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Then I restarted the MySQL server.
Hurray the Problem Solved.

 

I read similar article here: https://stackoverflow.com/questions/22806870/incorrect-datetime-value-database-error-number-1292

About author

ZERIN

CEO & Founder (BdBooking.com - Online Hotel Booking System), CEO & Founder (TaskGum.com - Task Managment Software), CEO & Founder (InnKeyPro.com - Hotel ERP), Software Engineer & Solution Architect

How To Setup a Subdomain with SSL on Amazon Linux 2 AMI

I assume that you can login to Amazon Linux 2 AMI ...

Read more

WHM:: PHP Mail is Not Working-Showing Its Disable

When your mail does not work, one example could be...

Read more

How to Whitelist IP/ finding if IP is Blacklisted in Linux CentOS

1. How to check if an IP is Blacklisted: If you wa...

Read more

There are 0 comments

Leave a Reply

Your email address will not be published. Required fields are marked *