Fixed: this is incompatible with sql_mode=only_full_group_by in MySQL

When you execute a query having GROUP BY against a database in MySQL you could have encountered the error "this is incompatible with sql_mode=only_full_group_by” in MySQL". Below are the steps to fix the issue.

1. Edit MySQL configuration
sudo nano /etc/mysql/conf.d/mysql.cnf

2. Append below code and save and exit
[mysqld]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

3. Restart MySQL server
sudo service mysql restart

Comments

Popular posts from this blog

Creating Protected routes in ReactJS

Add and use wow.js into WordPress theme