Mysql Errors and Solutions

Mysql errors and solutions

Error 1

1
sql_mode (this is incompatible with sql_ mode=only_full_group_by)

1) show sql_mode settings:

1
2
3
4
5
6
select @@sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+

2) runtime setting.
Delete only_full_group_by from sql_mode
this is only useful at run time, when you resatrt your mysql, it will disabled:

1
set sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"; -- except ONLY_FULL_GROUP_BY

3) gloable setting.
set sql_mode at /ect/mysql/my.cnf file, add this line to my.cnf file:

1
2
[mysqld]
sql-mode="NO_ENGINE_SUBSTITUTION" -- "" is your settings, you can use "select @@sql_mode" to find current settings and decide to change to waht.