MYSQL

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by"

jennyiscoding 2024. 7. 30. 15:02

에러내용 

File "/usr/local/lib/python3.12/site-packages/MySQLdb/connections.py", line 261, in query
2024-07-30 14:59:00     _mysql.connection.query(self, query)
2024-07-30 14:59:00 django.db.utils.OperationalError: (1055, "Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'deeplounge_a.guest.race' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by")

 

해결방법

sudo vi /usr/local/etc/my.cnf

# Default Homebrew MySQL server config
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION

# Only allow connections from localhost
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
"/usr/local/etc/my.cnf" 7L, 178B

 

저장. 끝.