I installed mysql in my note and I'm using Linux Mint 18.2. When I run the query:
SELECT *,SUM(ValorTotalProdutos) AS ValorTotal, SUM(QtdProdutos) AS QtdFinal FROM tabela WHERE SESSIONID = '77c2c1de02e94581a459ed2d4fa76370' AND StatusCompras = 'A'
The error appears:
#1140 - In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'banco.tabela.IDCarrinho'; this is incompatible with sql_mode=only_full_group_by
I opened the file my.cnf
sudo nano /etc/mysql/my.cnf
And includes at the end of the file:
sql-mode=""
I restarted mysql:
sudo service mysql restart
And it made a mistake. So I deleted the above command and added another line:
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
I restarted and the same error appeared. The error that appeared in both is:
sudo service mysql restart
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
How do I disable sql-mode?